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 APIinitargs referenceBoth, JS API
initanduseInithook use the same argument details.
Browse ourinitargs description in case you need to understanduseInitargs.
Hook Return Value
profile
profileType | Default |
|---|---|
null |
loaded
loadedType | Default |
|---|---|
boolean | false |
Updated 2 months ago
What’s Next
