Fatimah azzahra
Fatimah azzahra

Reputation: 11

laravel pusher error api key not in cluster

I tried using the pusher on Laravel to make a realtime notification, 41/5000 I have entered the app key into env but I got an error like this

        {  
           "type":"WebSocketError",
           "error":{  
              "type":"PusherError",
              "data":{  
                 "code":4001,
                 "message":"App key API_KEY_HERE not in this cluster. Did you forget to specify the cluster?"
              }
           }
        }

someone please help me thanks

Upvotes: 1

Views: 10738

Answers (3)

Mohammed AL MahmoOd
Mohammed AL MahmoOd

Reputation: 101

add cluster value when calling pusher in the client

var pusher = new Pusher('************', {
      cluster: 'us2'
    });

Upvotes: 1

zobay
zobay

Reputation: 106

For Same problem, I have solved this one by providing the PUSHER_APP_CLUSTER value from pusher's cluster value. I mean, in pusher App keys section, they provide a cluster value. That resolves my issue.

Upvotes: 0

Sean Whelan
Sean Whelan

Reputation: 319

I too encountered this error when I first used Pusher with Laravel. You have most likely set a different cluster location in Pusher than Laravel's default.

In .env make sure you have PUSHER_APP_CLUSTER set to the cluster you chose when you first created your app, such as eu, mt1, us1, etc.

You can also edit this setting in config/broadcasting.php along with the rest of Pusher's settings.

Laravel documentation for reference.

Upvotes: 3

Related Questions