FutureverseAuthClient

To start using Auth React in your application, you need to import FutureverseAuthClient and instantiate it by providing the following parameters:

The code below shows how to instantiate your FutureverseAuthClient and initialize the variable authClient.

Example:

import { FutureverseAuthClient } from '@futureverse/auth-react';

const clientId = '<your-futureverse-client-id>';

const authClient = new FutureverseAuthClient({
  clientId,
  environment: 'production',
  redirectUri: '<your-app-redirect-endpoint>',
});

Use the same client ID and redirect URI for the environment you configured your client in. clientId and redirectUri are required parameters.

  • clientId: The client ID you obtained following the steps to Register your client in Getting Started.

  • environment: the environment used (development/staging/production).

  • redirectUri: The redirect URL you used when registering your client in the previous step - It is the URI in your application that the successful authentication should redirect to.

FutureverseAuthClient also accepts four other optional parameters:

  • responseType: code or id_token string

  • userStore

  • clientSecret

  • signInFlow: redirect or popup string

Developers who opt to use the Auth UI plug and play modal, supplied by AuthUiProvider, must include a signInFlow parameter with 'popup' as its value.

Last updated

© 2023 -> ♾️