Skip to content
Client
Server

Reference / @open-music-sdk/server / tTokenEndpointOptions

Interface: tTokenEndpointOptions ​

Defined in: integrations/server/src/token-endpoint.ts:7

Invalid values throw a TypeError when the endpoint is made.

Extends ​

Properties ​

keyId ​

ts
readonly keyId: string;

Defined in: packages/developer-token/src/mint.ts:19

The ID of the MusicKit key, the ten capital letters and digits in the file's name; becomes kid.

Inherited from ​

ts
Omit.keyId

origin ​

ts
readonly origin: readonly string[];

Defined in: integrations/server/src/token-endpoint.ts:13

The web origins the token is for, one at least, each exactly as a browser sends it: https://app.example, with no path and no trailing slash. Apple honours the claim for requests from browsers, and a request from one of these origins is answered with the CORS headers that let its page read the token.


pem ​

ts
readonly pem: string;

Defined in: packages/developer-token/src/mint.ts:15

The contents of AuthKey_XXXXXXXXXX.p8: a PKCS8 PEM. Line breaks escaped as \n, as an environment variable usually holds them, are accepted, and so are Windows line endings, a byte order mark and whitespace around it.

Inherited from ​

ts
Omit.pem

refreshAheadSeconds? ​

ts
readonly optional refreshAheadSeconds?: number;

Defined in: packages/developer-token/src/mint.ts:33

Mint a replacement this long before exp. Default, and at most, half the lifetime.

Inherited from ​

ts
Omit.refreshAheadSeconds

teamId ​

ts
readonly teamId: string;

Defined in: packages/developer-token/src/mint.ts:17

Your Apple Developer Team ID, ten capital letters and digits as Apple issues it; becomes iss.

Inherited from ​

ts
Omit.teamId

ttlSeconds? ​

ts
readonly optional ttlSeconds?: number;

Defined in: integrations/server/src/token-endpoint.ts:15

The token's lifetime in whole seconds, from 60 to 86 400, one day. Default 900, fifteen minutes: a page can be read by anyone, and so can its token.

MIT licensed. Not affiliated with, endorsed by, or sponsored by Apple Inc. Apple Music and MusicKit are trademarks of Apple Inc.