Install Auth SDK
Learn how to configure the Wristband SDK for your NextJS application.
Installation
Install the Wristband Auth SDK using your preferred package manager CLI:
npm install @wristband/nextjs-authyarn add @wristband/nextjs-authpnpm add @wristband/nextjs-authConfiguration
Prerequisites
Before you can configure the SDK, you'll need to make sure you have the following values:
- WRISTBAND_APPLICATION_VANITY_DOMAIN
- WRISTBAND_CLIENT_ID
- WRISTBAND_CLIENT_SECRET
If you went through the Set Up a Wristband Application guide, you should have been presented with these three values after the application was provisioned. If you don't have the above values on hand, you can retrieve them from the Wristband dashboard by following the steps in this guide.
Configuring the SDK
Create an instance of WristbandAuth in the source root directory of your NextJS project (e.g.src/wristband-auth.ts). Update the AuthConfig properties with the values for your application.
import { createWristbandAuth } from '@wristband/nextjs-auth';
import type { AuthConfig } from '@wristband/nextjs-auth';
const authConfig: AuthConfig = {
clientId: '<WRISTBAND_CLIENT_ID>',
clientSecret: '<WRISTBAND_CLIENT_SECRET>',
wristbandApplicationVanityDomain: '<WRISTBAND_APPLICATION_VANITY_DOMAIN>',
};
export const wristbandAuth = createWristbandAuth(authConfig);
Updated 17 days ago
Next, you'll use the Wristband SDK to create the necessary authentication endpoints in your NextJS server.