Created
November 14, 2021 02:02
-
-
Save hieptl/3414a86b2d0cec4bd4e8156f5b18f7ca to your computer and use it in GitHub Desktop.
SignUp.js - Create CometChat Account - Discord Clone
This file contains hidden or 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
const createCometChatAccount = ({ userUuid, fullname, userAvatar }) => { | |
const authKey = `${process.env.REACT_APP_COMETCHAT_AUTH_KEY}`; | |
const user = new cometChat.User(userUuid); | |
user.setName(fullname); | |
user.setAvatar(userAvatar); | |
cometChat.createUser(user, authKey).then( | |
user => { | |
setIsLoading(false); | |
}, error => { | |
setIsLoading(false); | |
} | |
) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment