Skip to main content

Resource Fetching API

Use the standard web fetch() method to make authenticated calls to the Shopify GraphQL Admin API and to your app's backend.

Because your app runs in an iframe, it can't natively make these requests. When you make a call using fetch(), App Bridge intercepts the method and handles authentication automatically.

For requests to the Shopify GraphQL Admin API, use the shopify:admin/ URL scheme, and ensure that Direct API access is enabled for your app in its TOML configuration file.

For requests to your app's domain and subdomains, App Bridge automatically adds an OpenID Connect ID Token in the Authorization header, along with the shop's locale in Accept-Language.

You can disable interception of the fetch() method by using the disabledFeatures configuration option. For more information about general usage of fetch(), see the Fetch API documentation.

  • Authenticated requests: Send fetch requests to your app's backend that are automatically authenticated with an ID token.
  • API calls: Make authenticated calls to your app's API without manually managing authorization headers.
  • Subdomain support: Access resources on your application domain and subdomains with automatic authentication.
  • Direct API access: Use the global fetch function with built-in Shopify authentication for seamless data fetching.

Was this page helpful?