Skip to content

ベータ

これらの App Bridge コンポーネントは新しく、ベータ期間中はマイナーリリースで API が変わる可能性があります。動作は、ローカルの E2E スイートが実際の Shopify 管理画面で確認しています。うまく動かない場合は issue を作成してください。

認証とデータ ​

Shopify が「認証とデータ」に分類している API と、それらだけが使う型です。このページ:AppApi、AppBridgeConfig、EnvironmentApi、IdTokenApi、Scopes、UserApi。

AppApi ​

interface

extensions(): Promise<ExtensionInfo[]>

The list of extensions from the current app.

使用箇所: useAppBridge(), ShopifyGlobal

ExtensionInfo ​

interface

型パラメーター: Type extends ExtensionType = ExtensionType

handle: string

The unique identifier for the extension.

activations: Type extends "ui_extension" ? UiExtensionActivation[] : Type extends "theme_app_extension" ? ThemeExtensionActivation[] : never

List of activation records for the extension. The shape depends on the extension type:

  • UI extensions have activations with only target
  • Theme app extensions have nested activations representing blocks/embeds

type: Type

The type of the extension.

使用箇所: AppApi

ExtensionType ​

type
ts
type ExtensionType = "ui_extension" | "theme_app_extension";

使用箇所: ExtensionInfo

ThemeExtensionActivation ​

interface

target: ThemeAppBlockTarget | ThemeAppEmbedTarget

The target location type for this block/embed.

  • section for blocks
  • head, body, or compliance_head for embeds

handle: string

The filename of the block/embed within the theme app extension (without extension). This is configured by the developer when creating the block file.

name: string

The developer-configured display name of this block/embed, defined in the block's schema.

関連: https://shopify.dev/docs/apps/build/online-store/theme-app-extensions/configuration#schema

status: ActivationStatus

The availability status of this block/embed.

activations: ThemeAppBlockActivation[]

List of theme-specific activations for this block/embed. Contains where the block is actually placed within themes.

使用箇所: ExtensionInfo

UiExtensionActivation ​

interface

target: string

The target identifier for the extension activation. For example, purchase.thank-you.block.render.

使用箇所: ExtensionInfo

ActivationStatus ​

type
ts
type ActivationStatus = "active" | "available" | "unavailable";

使用箇所: ThemeExtensionActivation

ThemeAppBlockActivation ​

interface

target: string

The target identifier for the block/embed placement within the theme. For example, template--product.alternate/main/my_app_product_rating_GPzUYy.

themeId: string

The theme ID where this block/embed is activated. Format: gid://shopify/OnlineStoreTheme/{id}

使用箇所: ThemeExtensionActivation

ThemeAppBlockTarget ​

type
ts
type ThemeAppBlockTarget = "section";

使用箇所: ThemeExtensionActivation

ThemeAppEmbedTarget ​

type
ts
type ThemeAppEmbedTarget = "head" | "body" | "compliance_head";

使用箇所: ThemeExtensionActivation

AppBridgeConfig ​

interface

apiKey: string

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.

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').

debug?: DebugOptions

Configuration for enabling Web Vitals performance logging.

Use this property during development for identifying performance issues.

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.

experimentalFeatures?: string[]

The experimental features to enable in your app.

This allows app developers to opt-in to experiement features.

host?: 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.

locale?: string

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.

デフォルト: 'en-US'

shop?: 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.

使用箇所: useAppBridge(), ShopifyGlobal

DebugOptions ​

interface

webVitals?: boolean

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.

デフォルト: false

使用箇所: AppBridgeConfig

EnvironmentApi ​

interface

継承: Required<_EnvironmentApi>

使用箇所: useAppBridge(), ShopifyGlobal

_EnvironmentApi ​

interface

mobile?: boolean

Whether the app is running inside the Shopify Mobile app.

embedded?: boolean

Whether the app is embedded in the Shopify admin.

pos?: boolean

Whether the app is running inside the Shopify POS app.

intent?: boolean

Whether the app is running as an intent.

使用箇所: EnvironmentApi

IdTokenApi ​

function
ts
type IdTokenApi = () => Promise<string>;

使用箇所: useAppBridge(), ShopifyGlobal

Scopes ​

interface

query: () => Promise<ScopesDetail>

Returns the current access scopes for this app on this shop, including which are granted, required, and optional.

request: (scopes: Scope[]) => Promise<ScopesRequestResponse>

Opens a permission grant modal asking the merchant to grant the specified scopes.

The scopes must be access scope handles (for example, 'read_products' or 'write_orders') that are declared as optional in your app configuration.

See the permission grant modal documentation for more details.

revoke: (scopes: Scope[]) => Promise<ScopesRevokeResponse>

Revokes the specified optional scopes from this app on this shop.

The scopes must be access scope handles (for example, 'read_products' or 'write_orders') that are currently granted and declared as optional. Required scopes cannot be revoked.

使用箇所: useAppBridge(), ShopifyGlobal

Scope ​

type
ts
type Scope = string;

使用箇所: Scopes, ScopesDetail

ScopesDetail ​

interface

granted: Scope[]

The scopes currently granted to this app on this shop. This includes both required and optional scopes.

required: Scope[]

The scopes declared as required in your app configuration. These are always granted at install time and cannot be revoked by the app.

optional: Scope[]

The scopes declared as optional in your app configuration. These may or may not be currently granted — check granted to see which are active.

ScopesRequestResponse ​

interface

result: UserResult

The merchant's response: 'granted-all' if they accepted all requested scopes, or 'declined-all' if they declined.

detail: ScopesDetail

The updated scopes for this app on this shop after the merchant's response.

使用箇所: Scopes

ScopesRevokeResponse ​

interface

detail: ScopesDetail

The updated scopes for this app on this shop after the revocation.

使用箇所: Scopes

UserResult ​

type
ts
type UserResult = "granted-all" | "declined-all";

使用箇所: ScopesRequestResponse

UserApi ​

function
ts
type UserApi = () => Promise<User>;

参照する型: User使用箇所: useAppBridge(), ShopifyGlobal

User ​

interface

使用箇所: UserApi

AdminUser ​

interface

accountAccess?: string

The account access level of the logged-in user.

locale?: string

Host regional format. Copied onto shopify.config.locale.

使用箇所: PrivilegedAdminUser, User

POSUser ​

interface

id?: number

The staff member's numeric ID.

firstName?: string

The user's first name.

lastName?: string

The user's last name.

email?: string

The user's email address.

accountAccess?: string

The account access level of the logged-in user.

accountType?: string

The user's account type.

使用箇所: User

PrivilegedAdminUser ​

interface

継承: AdminUser

id?: number

The staff member's numeric ID.

name?: string

The staff member's full name.

email?: string

The staff member's email address.

使用箇所: User

MIT ライセンスの下で公開されています。Vue ロゴは Evan You によるもの(CC BY-NC-SA 4.0)。