-
-
Save rjkz808/86fe497ce134244bd4e82fc24881a658 to your computer and use it in GitHub Desktop.
Photon Chat JavaScript SDK custom authentication
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <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