Skip to content

Commit

Permalink
Merge pull request #20 from ably-forks/fix/readme-ably-clientOptions
Browse files Browse the repository at this point in the history
Update README ably clientOptions
  • Loading branch information
sacOO7 authored Mar 22, 2023
2 parents 4787d9e + 5335bc6 commit c1a79b4
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,23 @@ window.Echo.connector.ably.connection.on(stateChange => {
}
});
```
You can set additional ably-js [clientOptions](https://ably.com/docs/api/realtime-sdk?lang=javascript#client-options) when creating an `Echo` instance.

- Take a look at [laravel broadcasting auth-endpoint doc](https://laravel.com/docs/broadcasting#customizing-the-authorization-endpoint) for customizing authEndpoint.
```
broadcaster: 'ably',
authEndpoint: 'http://www.localhost:8000/broadcasting/auth', // absolute or relative url to laravel-server
port: '80',
environment : 'custom-environment', // https://ably.com/docs/platform-customization#setting-up-a-custom-environment
echoMessages: true // By default self-echo for published message is false
authEndpoint: '/broadcasting/auth' // relative or absolute url to laravel-server
```

- You can set additional ably-js [clientOptions](https://ably.com/docs/api/realtime-sdk?lang=javascript#client-options) when creating an `Echo` instance.
- [Auth specific clientOptions](https://sdk.ably.com/builds/ably/specification/main/features/#AO1) should not be used, since laravel `authEndpoint` is already responsible for token authentication and external auth mechanism is not needed.

```
broadcaster: 'ably',
echoMessages: true, // self-echo for published message is set to false internally.
queueMessages: true, // default: true, maintains queue for messages to be sent.
disconnectedRetryTimeout: 15000, // Retry connect after 15 seconds when client gets disconnected
```

Once you have uncommented and adjusted the Echo configuration according to your needs, you may compile your application's assets:

```shell
Expand Down

0 comments on commit c1a79b4

Please sign in to comment.