Last active
July 28, 2022 01:54
-
-
Save leemartin/0dac81a74a58f8587270dca9089ddb7f to your computer and use it in GitHub Desktop.
Apple Music API Token for MusicKit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
const fs = require("fs"); | |
const jwt = require("jsonwebtoken"); | |
const privateKey = fs.readFileSync("AuthKey.p8").toString(); | |
const teamId = "ABCDE12345"; | |
const keyId = "ABCDE12345"; | |
const jwtToken = jwt.sign({}, privateKey, { | |
algorithm: "ES256", | |
expiresIn: "180d", | |
issuer: teamId, | |
header: { | |
alg: "ES256", | |
kid: keyId | |
} | |
}); | |
console.log(jwtToken); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment