Resource Fetching
The fetch
API allows you to send a fetch request that is authenticated with an OpenID Connect ID Token from Shopify in the Authorization
header. This is authenticated for your application domain and subdomains. See the Fetch API documentation for more details.
App Bridge injects automatic authorization into the global fetch
function. While this is transparent and should not interfere with existing fetch code, this injection can be disabled using the disabledFeatures
configuration option.
Was this section helpful?
Fetch
fetch('/api/endpoint');
Anchor to examplesExamples
Fetch with different options
Anchor to example-fetch-with-custom-headersFetch with custom headers
Fetch with custom headers
Anchor to example-fetch-directly-from-the-admin-apiFetch directly from the Admin API
Fetch directly from the Admin API using Direct API access
Was this section helpful?
Fetch with custom headers
fetch('/api/endpoint', {
headers: {'accept-language': 'fr'},
});