@pangeacyber/vanilla-js
TypeScript icon, indicating that this package has built-in type declarations

0.1.11 • Public • Published


Pangea Logo


documentation Discourse


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();

Readme

Keywords

none

Package Sidebar

Install

npm i @pangeacyber/vanilla-js

Weekly Downloads

126

Version

0.1.11

License

MIT

Unpacked Size

477 kB

Total Files

19

Last publish

Collaborators

  • tripletooth
  • colin.fagan
  • ggallien.pangea