---
url: https://polaris-vue-elements.dev/app-bridge/types/authentication-and-data.md
description: >-
  Types of the App Bridge authentication and data APIs in
  @shopify/app-bridge-types, for Vue 3: their members and the types only they
  use.
---

# Authentication and data {#authentication-and-data}

> **Beta:** These App Bridge components are new, and their API may change in a minor release while in beta. Their behaviour is checked in a live Shopify admin by a local E2E suite. If something doesn't work, please [open an issue](https://github.com/HQCuong/polaris-vue/issues).

The APIs Shopify lists under authentication and data, and the types only they use. On this page: [`AppApi`](#appapi), [`AppBridgeConfig`](#appbridgeconfig), [`EnvironmentApi`](#environmentapi), [`IdTokenApi`](#idtokenapi), [`Scopes`](#scopes), [`UserApi`](#userapi).

## `AppApi` {#appapi}

`extensions(): Promise<ExtensionInfo[]>`

The list of extensions from the current app.

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `ExtensionInfo` {#extensioninfo}

Type parameters: `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.

Used in: [`AppApi`](#appapi)

### `ExtensionType` {#extensiontype}

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

Used in: [`ExtensionInfo`](#extensioninfo)

### `ThemeExtensionActivation` {#themeextensionactivation}

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

See: <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.

Used in: [`ExtensionInfo`](#extensioninfo)

### `UiExtensionActivation` {#uiextensionactivation}

`target: string`

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

Used in: [`ExtensionInfo`](#extensioninfo)

### `ActivationStatus` {#activationstatus}

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

Used in: [`ThemeExtensionActivation`](#themeextensionactivation)

### `ThemeAppBlockActivation` {#themeappblockactivation}

`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}`

Used in: [`ThemeExtensionActivation`](#themeextensionactivation)

### `ThemeAppBlockTarget` {#themeappblocktarget}

```ts
type ThemeAppBlockTarget = "section";
```

Used in: [`ThemeExtensionActivation`](#themeextensionactivation)

### `ThemeAppEmbedTarget` {#themeappembedtarget}

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

Used in: [`ThemeExtensionActivation`](#themeextensionactivation)

## `AppBridgeConfig` {#appbridgeconfig}

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

Default: `'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.

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `DebugOptions` {#debugoptions}

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

Default: `false`

Used in: [`AppBridgeConfig`](#appbridgeconfig)

## `EnvironmentApi` {#environmentapi}

Extends: `Required<_EnvironmentApi>`

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `_EnvironmentApi` {#\_environmentapi}

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

Used in: [`EnvironmentApi`](#environmentapi)

## `IdTokenApi` {#idtokenapi}

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

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

## `Scopes` {#scopes}

`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](https://shopify.dev/docs/api/usage/access-scopes) handles (for example, `'read_products'` or `'write_orders'`) that are declared as optional in your app configuration.

See the [permission grant modal](https://shopify.dev/docs/apps/build/authentication-authorization/app-installation/manage-access-scopes#request-access-scopes-using-the-app-bridge-api-for-embedded-apps) 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](https://shopify.dev/docs/api/usage/access-scopes) handles (for example, `'read_products'` or `'write_orders'`) that are currently granted and declared as optional. Required scopes cannot be revoked.

Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `Scope` {#scope}

```ts
type Scope = string;
```

Used in: [`Scopes`](#scopes), [`ScopesDetail`](#scopesdetail)

### `ScopesDetail` {#scopesdetail}

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

Used in: [`Scopes`](#scopes), [`ScopesRequestResponse`](#scopesrequestresponse), [`ScopesRevokeResponse`](#scopesrevokeresponse)

### `ScopesRequestResponse` {#scopesrequestresponse}

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

Used in: [`Scopes`](#scopes)

### `ScopesRevokeResponse` {#scopesrevokeresponse}

`detail: ScopesDetail`

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

Used in: [`Scopes`](#scopes)

### `UserResult` {#userresult}

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

Used in: [`ScopesRequestResponse`](#scopesrequestresponse)

## `UserApi` {#userapi}

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

References: [`User`](#user)
Used in: [useAppBridge()](/app-bridge/use-app-bridge), [`ShopifyGlobal`](/app-bridge/types/#shopifyglobal)

### `User` {#user}

Extends: `PrivilegedAdminUser`, `AdminUser`, `POSUser`

Used in: [`UserApi`](#userapi)

### `AdminUser` {#adminuser}

`accountAccess?: string`

The account access level of the logged-in user.

`locale?: string`

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

Used in: [`PrivilegedAdminUser`](#privilegedadminuser), [`User`](#user)

### `POSUser` {#posuser}

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

Used in: [`User`](#user)

### `PrivilegedAdminUser` {#privilegedadminuser}

Extends: `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.

Used in: [`User`](#user)
