Authentication

This page describes the authentication methods used by White Label Loyalty (WLL) services:

  • "Admin Authentication" — a WLL-issued administrator token.

  • "Tenant Authentication" — a token typically issued by your system for end users.

In this guide, Admin Authentication refers to a WLL-issued admin token and Tenant Authentication refers to a token issued for an end user to use.

Admin authentication is provided via the AdminAuthProvider.

import { AdminAuthProvider } from '@wll-sdk/api';

Example: initializing the WLL Rewards SDK with an AdminAuthProvider

admin.ts
import { WLLRewardsSdk, AdminAuthProvider } from '@wll-sdk/api';

new WLLRewardsSdk({
  apiKey: '<your-api-key>',
  authProvider: new AdminAuthProvider({
    clientId: '<your-client-id>',
    clientSecret: '<your-client-secret>',
  }),
  baseUrl: 'https://api.rewards.wlloyalty.net/v1',
});

The AdminAuthProvider will automatically extract which region you are using from the baseUrl and attempt to authenticate. Current regions supported by the SDK:

  • EU

  • US

AdminAuthConfig Reference

Property
type
Required?

clientId

string

Y

clientSecret

string

Y

grantType

string?

N

audience

string?

N

scope

string?

N

Last updated

Was this helpful?