Skip to content

Instantly share code, notes, and snippets.

@hieptl
Created October 18, 2021 14:08
Show Gist options
  • Save hieptl/823d09d14ddbe47ca85187fa24428e53 to your computer and use it in GitHub Desktop.
Save hieptl/823d09d14ddbe47ca85187fa24428e53 to your computer and use it in GitHub Desktop.
SignUp.tsx - Register CometChat Account - Ionic Chat App
...
// cometchat auth key
const authKey = `${process.env.REACT_APP_COMETCHAT_AUTH_KEY}`;
// call cometchat service to register a new account.
const user = new cometChat.User(firebaseUid);
user.setName(fullname);
user.setAvatar(userAvatar);
cometChat.createUser(user, authKey).then(
(user: any) => {
alert(`${userCrendentials.user.email} was created successfully! Please sign in with your created account`);
setIsLoading(false);
}, (error: any) => {
setIsLoading(false);
}
)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment