pusher / pusher-js

Pusher Javascript library
http://pusher.com
MIT License
2.11k stars 374 forks source link

Is it possible to supply the auth token as a parameter? #710

Closed tbell511 closed 1 year ago

tbell511 commented 1 year ago

Quick question...

Instead of supplying an auth URL that returns the token, is there is way to set the token to avoid having that additional request?

I'm asking because I can easily supply the auth token in my apps init call. That would prevent me from having to add an additional endpoint to my api.

Thanks.

tbell511 commented 1 year ago

Seems like I may have found the answer.

customHandler (Function) - When present, this function is called instead of a request being made to the endpoint specified by userAuthentication.endpoint.

benw-pusher commented 1 year ago

Yep using the customHander function would be the correct way to achieve this.