1.1.0 • Published 1 year ago

fullstory-register-user v1.1.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Contents

Fullstory-Register-User

This React component is for registering the user to Fullstory with their name and email. Passing additional parameters is optional.

Issue And Solution

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.

How to use

npm i fullstory-register-user
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 <div >loading...</div>;
  }
  if ( error ) {
    return <div>Oops... { error.message }</div>;
  }
  if ( isAuthenticated ) {
    return (
        <>
            <RegisterUser user={ user } org={ "YOUR FULLSTORY ID" } />
            <Switch>
                <Route exact path="/" render={()=> <PrivateComponent />}/>
                <Route exact path="/other" render={()=> <OtherComponent />}/>
            </Switch>
        </>
    );
  } else {
    loginWithRedirect();
    return null;
  }
};

Passing Options

OptionsDefaultRequiredResult
usernulltrueThe user to be registered with Fullstory
orgnulltrueRegisters Fullstory
envnullfalseSpecifies 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.

OptionsDefaultRequiredResult
idnulltrueuid is a string containing a unique identifier for the current user
namenulltrueName of user
emailnulltrueEmail 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.
1.1.0

1 year ago

0.3.4

1 year ago

0.3.3

2 years ago

0.3.23

2 years ago

0.3.22

2 years ago

0.3.21

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago