private initializeSdk()

in src/SpotifyApi.ts [116:133]


    private initializeSdk(config: SdkOptions | undefined): SdkConfiguration {
        const isBrowser = typeof window !== 'undefined';

        const defaultConfig: SdkConfiguration = {
            fetch: (req: RequestInfo | URL, init: RequestInit | undefined) => fetch(req, init),
            beforeRequest: (_: string, __: RequestInit) => { },
            afterRequest: (_: string, __: RequestInit, ___: Response) => { },
            deserializer: new DefaultResponseDeserializer(),
            responseValidator: new DefaultResponseValidator(),
            errorHandler: new NoOpErrorHandler(),
            redirectionStrategy: new DocumentLocationRedirectionStrategy(),
            cachingStrategy: isBrowser
                ? new LocalStorageCachingStrategy()
                : new InMemoryCachingStrategy()
        };

        return { ...defaultConfig, ...config };
    }