Skip to content

Parra-Inc/parra-access-token-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 }

About

Utility class for signing Parra Access Token with node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published