Skip to content
Client
Server

Reference / @open-music-sdk/developer-token / tFetcherOptions

Interface: tFetcherOptions ​

Defined in: fetcher.ts:9

Invalid values throw a TypeError.

Properties ​

fetch? ​

ts
readonly optional fetch?: {
  (input, init?): Promise<Response>;
  (input, init?): Promise<Response>;
};

Defined in: fetcher.ts:11

Default: the global fetch. Wrap it to add credentials or headers your endpoint needs.

Call Signature ​

ts
(input, init?): Promise<Response>;

MDN Reference

Parameters ​
input ​

URL | RequestInfo

init? ​

RequestInit

Returns ​

Promise<Response>

Call Signature ​

ts
(input, init?): Promise<Response>;

MDN Reference

Parameters ​
input ​

string | Request | URL

init? ​

RequestInit

Returns ​

Promise<Response>


refreshAheadSeconds? ​

ts
readonly optional refreshAheadSeconds?: number;

Defined in: fetcher.ts:13

Fetch a replacement this long before exp. Default, and at most, half the life the token had left when it arrived.


timeoutMs? ​

ts
readonly optional timeoutMs?: number;

Defined in: fetcher.ts:18

How long the endpoint may take to answer, in whole milliseconds. Default 10 000; at most 2^31 - 1. It holds even when your fetch does not pass the abort signal on.

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