Zeyad Moheb
05/01/2025, 9:53 PMVapi Support Bot
05/01/2025, 9:55 PMjavascript
// Generate a new JWT token with appropriate expiration
const jwt = require('jsonwebtoken');
const token = jwt.sign({
// your payload here
}, privateKey, { expiresIn: '1h' });
Make sure you're using the correct private key (not public key) and include the token in your requests with Authorization: Bearer {token}.
Sources:
- [JWT Authentication Documentation](https://docs.vapi.ai/customization/jwt-authentication)
- [Discord Support Thread](https://discord.com/channels/1211482211119796234/1333897284894724188)Ὧρος
05/01/2025, 10:16 PMHunter (Dustin)
05/01/2025, 10:30 PMSRQ
05/01/2025, 10:42 PMVapi Support Bot
05/01/2025, 10:44 PMjavascript
const jwt = require('jsonwebtoken');
const token = jwt.sign({
orgId: process.env.ORG_ID
}, process.env.PRIVATE_KEY, { expiresIn: '24h' });
Ensure you're using the correct private key in PEM format and including the token in your requests with Authorization: Bearer ${token}.
Sources:
- [Discord Support Thread](https://discord.com/channels/1211482211119796234/1333897284894724188)
- [JWT Authentication Documentation](https://docs.vapi.ai/customization/jwt-authentication)TylerBrewer-EWS
05/02/2025, 12:11 AMTylerBrewer-EWS
05/02/2025, 12:13 AMChiranjeet Mishra
05/02/2025, 5:18 AMcade6974
05/02/2025, 9:40 PMChiranjeet Mishra
05/03/2025, 5:37 AM