Ably authCallback example

In this example, we demonstrate how an authCallback can be provided in ClientOptions to the client library allowing it to obtain a Token or TokenRequest at any point where it needs to authenticate. Typically, you would use an authCallback so that when a token is required, you would communicate with your servers to obtain a signed token to hand back to the client. This ensures the client never holds any private credentials and your servers are responsible for authentication.

See our authentication documentation for more details.