Post

Replies

Boosts

Views

Activity

Reply to Beginner trying to authorize Apple Music API request
@hntdhs you can create an auth token with something similar to this: const generateAppleMusicToken = async ({ filePath, issuer, kid, }: { filePath: string; issuer: string; kid: string }) => { console.log('Generating apply music token...') const privateKey = await readFile(filePath, { encoding: 'utf-8' }) return jwt.sign({}, privateKey, { issuer, expiresIn: '180d', header: { alg: 'ES256', kid, }, }) } you should have a .p8 file if you've signed up as an apple developer and created a key. For more info on JWTs, check out https://jwt.io/introduction
1w