-
-
Save mknepprath/c5582c8bbb3f11789b56b1eb8ab7564c 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
https://leemartin.medium.com/creating-an-apple-music-api-token-e0e5067e4281