Skip to content

Instantly share code, notes, and snippets.

Created January 26, 2018 12:52
What would you like to do?
JWT creation for
import request from 'request-promise-native';
import jwt from 'jsonwebtoken';
export default function makeRequest(requestAttributes, { apiKey, apiSecret }) {
const signed = jwt.sign({ key: apiKey }, apiSecret, { header: { kid: apiKey } });
return request(
auth: {
bearer: signed,
}, requestAttributes),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment