Kenetto Authenticator

Usage no npm install needed!

<script type="module">
  import kenettoKenettoAuthenticator from 'https://cdn.skypack.dev/@kenetto/kenetto-authenticator';




Install kenetto-authenticator via npm.

npm install --save @kenetto/kenetto-authenticator

Import the necessary components

import Auth, { Authenticator } from '@kenetto/kenetto-authenticator'

Create the configurationAuth0 with the necessary credentials. This should come from the environment variables.

The configuration must include domain, clientID, responseType, audience, scope and returnURI

Create an instance of the Auth class, which you will use for authentication.

const auth = new Auth(configurationAuth0, '/')

and add the following code to your render function inside of the <Switch /> Component:

  render={props => {
    return (
      <Authenticator auth={auth} {...props}>

The <div>loading...</div> should be replaced with the loading component of the app. This component will be shown when login occurs and will stay visible until the resolution of the authentication.

Use the auth.isAuthenticated() to check if user is authenticated. The function returns a boolean with the result.

Use the auth.logout(function) method to logout. The method should receive a function which will push the next page path.


Use the auth.login(redirectURI) to login and redirect to pretended web page which needs to be passes to the method as a property.


Use auth.getProfile() to get the profile of the currently logged user. The method receives a callback function and returns (err, profile).

auth.getProfile((error, profile) => {
    if (error) {
    if (profile) {