0.3.1 • Published 3 months ago

@parra/access-token v0.3.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

Parra Access Token Node

A utility class for signing Parra Access Token with node.js. For more information on Parra Access Tokens, please visit our docs or check out our Node.js integration guide for assistance in integrating with Parra.

Installation

Run npm install @parra/access-token

Usage

The Parra Access Token utility is for backend use with Node.js. It should never be used in the frontend.

The following is a simple example demonstrating how to sign a JWT using the Parra Access Token utility:

const { AccessToken } = require("@parra/access-token")

const tenantId = process.env.PARRA_TENANT_ID
const apiKeyId = process.env.PARRA_API_KEY_ID
const apiKeySecret = process.env.PARRA_API_KEY_SECRET

const identity = "abc123" // The ID of the user in your system

const accessToken = new AccessToken(tenantId, apiKeyId, apiKeySecret, { identity })

const signedJwt = accessToken.toJwt()

// Payload to be returned to your user
const payload = { access_token: signedJwt }
0.3.1

3 months ago

0.3.0

1 year ago

0.2.0

2 years ago

0.1.0

2 years ago