useInit
The purpose of useInit
hook is to initialise the SDK as an alternative to init
JS API. Internally it uses init
JS API, creates a new user profile if no user profile token is passed or reuses existing user profile in case a user token is passed.
Example usage
const { profile, loaded } = useInit({
clientId: '<Client ID>',
});
Hook argument
JS API
init
args referenceBoth, JS API
init
anduseInit
hook use the same argument details.
Browse ourinit
args description in case you need to understanduseInit
args.
Hook Return Value
profile
profile
Type | Default |
---|---|
IUserProfile | null |
loaded
loaded
Type | Default |
---|---|
boolean | false |
Updated 12 months ago
What’s Next