A javascript SDK for using Pangea Client APIs in the browser.
Client Classes
- AuthNClient: Support for interacting with AuthN
v2/client
endpoints. - AuthNFlowClient: Support for interacting with AuthN
v2/flow
endpoints.
This package is provided with support for ESM and CommonJS.
yarn add @pangeacyber/vanilla-js
# or
npm install @pangeacyber/vanilla-js
import { AuthConfig, AuthNFlowClient } from "@pangeacyber/vanilla-js";
const config: AuthConfig = {
clientToken: PANGEA_CLIENT_TOKEN,
domain: PANGEA_DOMAIN,
callbackUri: CALLBACK_URI
};
const client = new AuthNClient(config);
# check if a user token is valid
const resp = await client.validate(USER_TOKEN);
import { AuthConfig, AuthNFlowClient } from "@pangeacyber/vanilla-js";
const config: AuthConfig = {
clientToken: PANGEA_CLIENT_TOKEN,
domain: PANGEA_DOMAIN,
callbackUri: CALLBACK_URI
};
const client = new AuthNFlowClient(config);
# start a auth flow session
const resp = await client.start();