- [Fullstory-Register-User](#fullstory-register-user) - [Issue And Solution](#issue-and-solution) - [How to use](#how-to-use) - [Passing Options](#passing-options) - [User](#user) - [Addtional Info](#addtional-info)
npm install fullstory-register-user
This React component is for registering the user to Fullstory with their name and email. Passing additional parameters is optional.
When the user signs in the first time to an app, Fullstory would log an anonymous user because of the redirect needed for signing in the user. This component eliminates the anonymous user being logged because it waits for the user to be authenticated before registering Fullstory and passing it the user.
```
npm i fullstory-register-user
` javascript
import { Auth0Provider, User, useAuth0 } from "@auth0/auth0-react";
import { RegisterUser } from 'fullstory-register-user';
const AuthenticatedRoutes = () => {
const { isLoading, isAuthenticated, user, loginWithRedirect, error } = useAuth0();
if ( isLoading ) {
return
Passing Options
| Options | Default | Required | Result |
| ----------- | ----------- |----------- | ----------- |
| user| null | true | The user to be registered with Fullstory|
| org | null | true | Registers Fullstory |
| env | null | false | Specifies what NODE_ENV to register Fullstory. If no env is specified then all NODE_ENV are registered. |
User
The user object is what is passed to Fullstory Identify. The user must have an id, name and email in order to register that user to Fullstory. any additonal parameters are optional.
| Options | Default | Required | Result |
| ----------- | ----------- |----------- | ----------- |
| id | null | true | uid is a string containing a unique identifier for the current user |
| name | null | true | Name of user |
| email | null | true | Email of user |
Additional Info
- All React dependencies for
Fullstory-Register-User are dependent on the application using the component. This is to avoid any version dependency conflicts.
- The Fullstory dependency uses "react-fullstory": "^1.4.0"` for registering the user.