Skip to content

Instantly share code, notes, and snippets.

@rjkz808

rjkz808/main.js Secret

Created December 2, 2019 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjkz808/86fe497ce134244bd4e82fc24881a658 to your computer and use it in GitHub Desktop.
Save rjkz808/86fe497ce134244bd4e82fc24881a658 to your computer and use it in GitHub Desktop.
Photon Chat JavaScript SDK custom authentication
/// <reference path="photon/Photon-Javascript_SDK.d.ts"/>
class ChatDemo extends Photon.Chat.ChatClient {
constructor() {
super(Photon.ConnectionProtocol.Ws, 'MY_APP_ID', '1.0');
const type = Photon.LoadBalancing.Constants.CustomAuthenticationType.Custom;
this.setCustomAuthentication('', type, {
'(string)message': 'some_data',
'(string)signature':'some_other_data'
});
}
}
window.onload = () => {
new ChatDemo().connectToRegionFrontEnd('EU');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment