Skip to content
Client
Server

Reference / @open-music-sdk/user-token / tIntakeOptions

Interface: tIntakeOptions ​

Defined in: user-token/src/intake.ts:11

Invalid values throw a TypeError when the handler is created.

Properties ​

store ​

ts
readonly store: tUserTokenStore;

Defined in: user-token/src/intake.ts:13

Where an accepted token is kept: the store your client's forUser() reads.


userId ​

ts
readonly userId: (req) => 
  | string
  | Promise<string | null | undefined>
  | null
  | undefined;

Defined in: user-token/src/intake.ts:19

The signed-in user this request belongs to, from your own session; the token is stored under it. Resolve to nothing when there is no session and the request is answered 401. This is the authentication: whoever it returns, the posted token is stored as theirs, so return the signed-in user from your own session.

Parameters ​

req ​

Request

Returns ​

| string | Promise<string | null | undefined> | null | undefined

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