Skip to main content

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.

  • 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.

The config API is available on the shopify global. All properties are synchronous and available immediately without awaiting a Promise.

Anchor to apiKey
apiKey
string
required

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 appOrigins
appOrigins
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://hostname or scheme://hostname:port (for example, 'https://example.com' or 'https://example.com:8443').

Anchor to debug
debug

Configuration for enabling Web Vitals performance logging.

Use this property during development for identifying performance issues.

Anchor to disabledFeatures
disabledFeatures
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.
string

The base64-encoded host of the shop that's embedding your app. When decoded, the value has the format admin.shopify.com/store/{shop-name}.

This property is automatically set by the host environment.

Anchor to locale
locale
string
Default: 'en-US'

The locale of the admin user viewing your app, as an IETF BCP 47 language tag (for example, 'en-US', 'fr-FR', 'ja-JP').

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.

string

The permanent .myshopify.com domain 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.


Was this page helpful?