Tutorial: PlatformProvider.fetchManifest

PlatformProvider.fetchManifest

Allows overriding a platform's default behavior when fetching manifests. Overwriting this call will change how Platform.launchContentManifest and fins links fetch manifests. All calls to Platform.fetchManifest will also pass through the override.

Example

const overrideCallback = (Provider) => {
    class Override extends Provider {
        async fetchManifest(payload, callerIdentity) {
            const { manifestUrl } = payload;

            // I want to fetch certain URLs from the platform provider so that renderer-side cookies will be sent
            if (manifestUrl === 'https://www.my-internal-manifest.com') {
                const manifest = await fetch(manifestUrl);
                return manifest.json();
            }

            // Any requests that might be cross-origin should still be sent from the browser process
            return super.fetchManifest(payload);
        }
    }
    return new Override();
}

fin.Platform.init({ overrideCallback });