@pangeacyber/vanilla-js
v0.1.11
Published
Generic javascript integrations with Pangea
Downloads
886
Keywords
Readme
Pangea Vanilla Javascript Package
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.
Installation
yarn add @pangeacyber/vanilla-js
# or
npm install @pangeacyber/vanilla-js
Usage
AuthNClient
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);
AuthNFlowClient
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();