pusher / pusher-websocket-react-native

React Native official Pusher SDK
MIT License
61 stars 52 forks source link

Insufficient Information in Documentation Regarding Custom Auth Endpoint Configuration #132

Open gustavomant opened 8 months ago

gustavomant commented 8 months ago

The documentation for Pusher WebSocket in React Native lacks the necessary information and clarity concerning the configuration of the custom auth endpoint field.

await pusher.init({ apiKey: API_KEY, cluster: API_CLUSTER, authEndPoint: "https://your-server.com/pusher/auth" });

What type of content should be returned from the custom auth endpoint? Is there a way to pass additional properties to the endpoint? As far as I know, only the URL can be passed, but there seems to be missing information on this.

benw-pusher commented 8 months ago

The response expected from an authEndpoint is defined at https://pusher.com/docs/channels/server_api/authorizing-users/#response. It is not possible to pass additional properties to the endpoint - if this is required then you can use our onAuthorizer parameter to build and execute your own HTTP request / auth process to generate and return the expected auth information.