Skip to content

Instantly share code, notes, and snippets.

@rjkz808

rjkz808/main.js Secret

Created Dec 2, 2019
Embed
What would you like to do?
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
You can’t perform that action at this time.