@vonage/jwt
v1.11.0
Published
Vonage JWT package. Creates JWT tokens for Vonage API's
Downloads
251,758
Maintainers
Keywords
Readme
Vonage JWT SDK for Node.js
This is the Vonage JWT SDK for Node.js. This package helps create JWT tokens to use with Vonage APIs.
For full API documentation refer to developer.vonage.com.
Installation
With NPM
npm install @vonage/jwt
With Yarn
yarn add @vonage/jwt
Usage
All you need to do is require('@vonage/jwt')
, and use the returned object tocreate your own JWT token.
const { tokenGenerate } = require('@vonage/jwt');
const jwtToken = tokenGenerate(applicationId, privateKey, generatorOptions);
Parameters
applicationId: string
- The Vonage Application Id.privateKey: string | Buffer
- The private key.generatorOptions: GeneratorOptions
- An object that can be used to set options for the token. See thejsonwebtoken
for all options and claims. You can also pass in a Vonageacl
Testing
Run:
npm run test