Laravel-websockets: Do I still need a pusher key?

Created on 6 Dec 2018  路  7Comments  路  Source: beyondcode/laravel-websockets

I can see in the example code provided in your documentation you have used something similar a lot:

'pusher' => [
    'driver' => 'pusher',
    'key' => env('PUSHER_APP_KEY'),
    'secret' => env('PUSHER_APP_SECRET'),
    'app_id' => env('PUSHER_APP_ID'),
    'options' => [
        'cluster' => env('PUSHER_APP_CLUSTER'),
        'encrypted' => true,
        'host' => '127.0.0.1',
        'port' => 6001,
        'scheme' => 'http'
    ],
],

and:

import Echo from "laravel-echo"

window.Pusher = require('pusher-js');

window.Echo = new Echo({
    broadcaster: 'pusher',
    key: 'your-pusher-key',
    wsHost: window.location.hostname,
    wsPort: 6001,
    disableStats: true,
});

So do I still need a PUSHER_APP_SECRET or PUSHER_APP_ID or PUSHER_APP_CLUSTER or pusher-key for this to work?!

Most helpful comment

Its not obvious from the docs

All 7 comments

You can generate every secret you want :) You don't need a Pusher Account anymore.

You can generate every secret you want :) You don't need a Pusher Account anymore.

Sorry if this is too much basic. But my understanding is pusher secret, app id, key are generated on Pusher. So are you saying, to use this websocket module, I don't need to define key, secret or app id?

I say you don't need to use a secret from pusher. You can generate every string you want :)

Thanks for that 馃憤

@mathewparet Did using random strings work for you?

@BenQoder check out https://docs.beyondco.de/laravel-websockets/1.0/getting-started/installation.html

There are the "random strings" defined. They're not totally random as in you can put in anything in the client, but are defined in websockets.php and can be anything you wish. As long as you use the PUSHER_* settings in your .env they will both be set in websockets.php and services.php and set everything correctly.

So if you follow along the installation you can set any random string it it will just work 鈩笍

Its not obvious from the docs

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sudden-break picture sudden-break  路  4Comments

rikless picture rikless  路  4Comments

semsphy picture semsphy  路  3Comments

connecteev picture connecteev  路  3Comments

darklight9811 picture darklight9811  路  4Comments