Config API
The config API provides synchronous access to configuration values for your app and for the shop it's embedded in.
Some values, such as shop, host, and locale, are automatically set by the host environment. For other values, such as apiKey, disabledFeatures, and appOrigins, you configure them using <meta> tags.
Anchor to Use casesUse cases
- Shop identification: Retrieve the current shop's myshopify.com domain for API calls or display purposes.
- App context: Access app configuration like API key and locale settings synchronously.
- Initialization: Read initial configuration values during app startup without awaiting async calls.
- Feature detection: Check disabled features to adapt app behavior based on configuration.
Anchor to PropertiesProperties
The config API is available on the shopify global. All properties are synchronous and available immediately without awaiting a Promise.
- Anchor to apiKeyapiKeyapiKeystringstringrequiredrequired
The client ID (also known as the API key) for your application, found in the Shopify Partner Dashboard under your app's settings.
You must provide this value using a
<meta name="shopify-api-key">tag.- Anchor to appOriginsappOriginsappOriginsstring[]string[]
An allowlist of origins that your app can send authenticated fetch requests to.
Set this property if your app needs to make authenticated requests to a domain other than your app's origin. Requests to your app's own domain (and its subdomains) are automatically allowed.
Each value must be an origin in the format
scheme://hostnameorscheme://hostname:port(for example,'https://example.com'or'https://example.com:8443').- Anchor to debugdebugdebugDebugOptionsDebugOptions
Configuration for enabling Web Vitals performance logging.
Use this property during development for identifying performance issues.
- Anchor to disabledFeaturesdisabledFeaturesdisabledFeaturesstring[]string[]
An array of App Bridge feature names to disable in your app.
Supported values:
'fetch'— Disables App Bridge's automatic fetch interceptor, which adds authentication headers to requests to the Shopify Admin API.'auto-redirect'— Disables automatic redirection when the app is loaded outside of the Shopify Admin.
- Anchor to hosthosthoststringstring
The base64-encoded host of the shop that's embedding your app. When decoded, the value has the format
.This property is automatically set by the host environment.
- Anchor to localelocalelocalestringstringDefault: 'en-US'Default: 'en-US'
The locale of the admin user viewing your app, as an IETF BCP 47 language tag (for example,
,,).This reflects the language the merchant has chosen for the Shopify admin, not the shop's customer-facing locale.
This property is automatically set by the host environment.
- Anchor to shopshopshopstringstring
The permanent
.myshopify.comdomain of the shop that's embedding your app (for example,'my-store.myshopify.com'). This is always the Shopify-assigned domain, not a custom domain.This property is automatically set by the host environment.
DebugOptions
- webVitals
Enables or disables the logging of web performance metrics (Web Vitals) in the browser's console. When set to `true`, the app will log Core Web Vitals (such as LCP, INP, and CLS) and other relevant performance metrics to help developers understand the real-world performance of their app. This can be useful for debugging performance issues during development or in a staging environment. This field is optional and defaults to `false`, meaning that web vitals logging is disabled by default to avoid performance overhead and unnecessary console output in production environments.
boolean