--- title: customer-account.page.render description: | This [full-page extension](/docs/api/customer-account-ui-extensions/2025-07/extension-targets-overview#full-page-extension-full-page-extension) allows you to create a new page in customer accounts. It renders in the main content area—below the header, and above the footer. If the page you're building is tied to a specific order, use [customer-account.order.page.render](/docs/api/customer-account-ui-extensions/targets/full-page/customer-account-order-page-render) instead. For example: - A Return Request page that requires the context of a specific order should use `customer-account.order.page.render` - A Wishlist page that does **not** require the context of a specific order should use `customer-account.page.render` A full-page extension target cannot coexist with any other targets in the same extension. api_version: 2025-07 api_name: customer-account-ui-extensions source_url: html: https://shopify.dev/docs/api/customer-account-ui-extensions/2025-07/targets/full-page/customer-account-page-render md: https://shopify.dev/docs/api/customer-account-ui-extensions/2025-07/targets/full-page/customer-account-page-render.md --- # customer-account.​page.​renderTarget This [full-page extension](https://shopify.dev/docs/api/customer-account-ui-extensions/2025-07/extension-targets-overview#full-page-extension-full-page-extension) allows you to create a new page in customer accounts. It renders in the main content area—below the header, and above the footer. If the page you're building is tied to a specific order, use [customer-account.order.page.render](https://shopify.dev/docs/api/customer-account-ui-extensions/targets/full-page/customer-account-order-page-render) instead. For example: * A Return Request page that requires the context of a specific order should use `customer-account.order.page.render` * A Wishlist page that does **not** require the context of a specific order should use `customer-account.page.render` A full-page extension target cannot coexist with any other targets in the same extension. ## FullPageApi The api for full-page extension targets * navigation FullExtensionNavigation required ### FullExtensionNavigation * addEventListener ```ts (type: "currententrychange", cb: (event: NavigationCurrentEntryChangeEvent) => void) => void ``` * currentEntry The currentEntry read-only property of the Navigation interface returns a NavigationHistoryEntry object representing the location the user is currently navigated to right now. ```ts NavigationHistoryEntry ``` * navigate The navigate() method navigates to a specific URL, updating any provided state in the history entries list. ```ts NavigateFunction ``` * removeEventListener ```ts (type: "currententrychange", cb: (event: NavigationCurrentEntryChangeEvent) => void) => void ``` * updateCurrentEntry The updateCurrentEntry() method of the Navigation interface updates the state of the currentEntry; used in cases where the state change will be independent of a navigation or reload. ```ts (options: { state: Record; }) => void ``` ```ts export interface FullExtensionNavigation extends StandardExtensionNavigation { /** * The currentEntry read-only property of the Navigation interface returns a NavigationHistoryEntry object representing the location the user is currently navigated to right now. */ currentEntry: NavigationHistoryEntry; /** * The updateCurrentEntry() method of the Navigation interface updates the state of the currentEntry; used in cases where the state change will be independent of a navigation or reload. */ updateCurrentEntry(options: {state: Record}): void; addEventListener( type: 'currententrychange', cb: (event: NavigationCurrentEntryChangeEvent) => void, ): void; removeEventListener( type: 'currententrychange', cb: (event: NavigationCurrentEntryChangeEvent) => void, ): void; } ``` ### NavigationCurrentEntryChangeEvent The NavigationCurrentEntryChangeEvent interface of the Navigation API is the event object for the currententrychange event, which fires when the Navigation.currentEntry has changed. * from Returns the NavigationHistoryEntry that was navigated from. ```ts NavigationHistoryEntry ``` * navigationType Returns the type of the navigation that resulted in the change. ```ts NavigationType ``` ```ts export interface NavigationCurrentEntryChangeEvent { /** * Returns the type of the navigation that resulted in the change. */ navigationType: NavigationType; /** * Returns the NavigationHistoryEntry that was navigated from. */ from: NavigationHistoryEntry; } ``` ### NavigationHistoryEntry The NavigationHistoryEntry interface of the Navigation API represents a single navigation history entry. * getState Returns a clone of the available state associated with this history entry. ```ts () => Record ``` * key Returns the key of the history entry. This is a unique, UA-generated value that represents the history entry's slot in the entries list rather than the entry itself. ```ts string ``` * url Returns the URL of this history entry. ```ts string ``` ```ts export interface NavigationHistoryEntry { /** Returns the key of the history entry. This is a unique, UA-generated value that represents the history entry's slot in the entries list rather than the entry itself. */ key: string; /** * Returns the URL of this history entry. */ url: string; /** * Returns a clone of the available state associated with this history entry. */ getState(): Record; } ``` ### NavigationType An enumerated value representing the type of navigation. ```ts 'push' | 'replace' | 'traverse' ``` ### NavigateFunction ```ts export interface NavigateFunction { /** * Navigates to a specific URL, updating any provided state in the history entries list. * @param url The destination URL to navigate to. */ (url: string, options?: NavigationOptions): void; } ``` ## StandardApi The base API object provided to this and other `customer-account` extension targets. * analytics Analytics required Methods for interacting with [Web Pixels](https://shopify.dev/docs/apps/marketing), such as emitting an event. Note Requires to [connect a third-party domain](https://help.shopify.com/en/manual/domains/add-a-domain/connecting-domains/connect-domain-customer-account) to Shopify for your customer account pages. * applyTrackingConsentChange ApplyTrackingConsentChangeType required Allows setting and updating customer privacy consent settings and tracking consent metafields. Note Requires the [`customer_privacy` capability](https://shopify.dev/docs/api/checkout-ui-extensions/unstable/configuration#collect-buyer-consent) to be set to `true`. [](https://shopify.dev/apps/store/data-protection/protected-customer-data)Requires access to [protected customer data](https://shopify.dev/docs/apps/store/data-protection/protected-customer-data). * authenticatedAccount AuthenticatedAccount required Information about the authenticated account. * customerPrivacy StatefulRemoteSubscribable\ required Customer privacy consent settings and a flag denoting if consent has previously been collected. * extension Extension required Meta information about the extension. * i18n I18n required Utilities for translating content and formatting values according to the current `localization` of the user. * localization Localization required Details about the language of the buyer. * navigation StandardExtensionNavigation required * query \(query: string, options?: { variables?: Variables; version?: StorefrontApiVersion; }) => Promise<{ data?: Data; errors?: GraphQLError\[]; }> required Used to query the Storefront GraphQL API with a prefetched token. See [storefront api access examples](https://shopify.dev/docs/api/customer-account-ui-extensions/apis/storefront-api#examples) for more information. * sessionToken SessionToken required Provides access to session tokens, which can be used to verify token claims on your app's server. See [session token examples](https://shopify.dev/docs/api/customer-account-ui-extensions/apis/session-token#examples) for more information. * settings StatefulRemoteSubscribable\ required The settings matching the settings definition written in the [`shopify.ui.extension.toml`](https://shopify.dev/docs/api/customer-account-ui-extensions/configuration) file. See [settings examples](https://shopify.dev/docs/api/customer-account-ui-extensions/apis/order-status-api/settings#examples) for more information. Note When an extension is being installed in the editor, the settings will be empty until a merchant sets a value. In that case, this object will be updated in real time as a merchant fills in the settings. * storage Storage required Key-value storage for the extension target. * ui Ui required Methods to interact with the extension's UI. * version Version required The renderer version being used for the extension. * extensionPoint Target required deprecated The identifier that specifies where in Shopify’s UI your code is being injected. This will be one of the targets you have included in your extension’s configuration file. Deprecated Deprecated as of version `2023-07`, use `extension.target` instead. ### Analytics * publish Publish method to emit analytics events to \[Web Pixels]\(/docs/apps/marketing). ```ts (name: string, data: Record) => Promise ``` * visitor A method for capturing details about a visitor on the online store. ```ts (data: { email?: string; phone?: string; }) => Promise ``` ```ts export interface Analytics { /** * Publish method to emit analytics events to [Web Pixels](/docs/apps/marketing). */ publish(name: string, data: Record): Promise; /** * A method for capturing details about a visitor on the online store. */ visitor(data: {email?: string; phone?: string}): Promise; } ``` ### VisitorResult Represents a visitor result. ```ts VisitorSuccess | VisitorError ``` ### VisitorSuccess Represents a successful visitor result. * type Indicates that the visitor information was validated and submitted. ```ts "success" ``` ```ts export interface VisitorSuccess { /** * Indicates that the visitor information was validated and submitted. */ type: 'success'; } ``` ### VisitorError Represents an unsuccessful visitor result. * message A message that explains the error. This message is useful for debugging. It's \*\*not\*\* localized, and therefore should not be presented directly to the buyer. ```ts string ``` * type Indicates that the visitor information is invalid and wasn't submitted. Examples are using the wrong data type or missing a required property. ```ts "error" ``` ```ts export interface VisitorError { /** * Indicates that the visitor information is invalid and wasn't submitted. * Examples are using the wrong data type or missing a required property. */ type: 'error'; /** * A message that explains the error. This message is useful for debugging. * It's **not** localized, and therefore should not be presented directly * to the buyer. */ message: string; } ``` ### ApplyTrackingConsentChangeType * visitorConsent ```ts VisitorConsentChange ``` Promise\ ```ts Promise ``` ```ts export type ApplyTrackingConsentChangeType = ( visitorConsent: VisitorConsentChange, ) => Promise; ``` ### VisitorConsentChange * analytics Visitor consents to recording data to understand how customers interact with the site. ```ts boolean ``` * marketing Visitor consents to ads and marketing communications based on customer interests. ```ts boolean ``` * metafields Tracking consent metafield data to be saved. If the value is \`null\`, the metafield will be deleted. ```ts TrackingConsentMetafieldChange[] ``` * preferences Visitor consent to remembering customer preferences, such as country or language, to personalize visits to the website. ```ts boolean ``` * saleOfData Opts the visitor out of data sharing / sales. ```ts boolean ``` * type ```ts "changeVisitorConsent" ``` ```ts export interface VisitorConsentChange extends VisitorConsent { /** * Tracking consent metafield data to be saved. * * If the value is `null`, the metafield will be deleted. * * @example `[{key: 'granularAnalytics', value: 'true'}, {key: 'granularMarketing', value: 'false'}]` */ metafields?: TrackingConsentMetafieldChange[]; type: 'changeVisitorConsent'; } ``` ### TrackingConsentMetafieldChange * key The name of the metafield. It must be between 3 and 30 characters in length (inclusive). ```ts string ``` * value The information to be stored as metadata. If the value is \`null\`, the metafield will be deleted. ```ts string | null ``` ```ts export interface TrackingConsentMetafieldChange { /** * The name of the metafield. It must be between 3 and 30 characters in * length (inclusive). */ key: string; /** * The information to be stored as metadata. If the value is `null`, the metafield will be deleted. * * @example 'any string', `null`, or a stringified JSON object */ value: string | null; } ``` ### TrackingConsentChangeResult ```ts TrackingConsentChangeResultSuccess | TrackingConsentChangeResultError ``` ### TrackingConsentChangeResultSuccess The returned result of a successful tracking consent preference update. * type The type of the \`TrackingConsentChangeResultSuccess\` API. ```ts "success" ``` ```ts export interface TrackingConsentChangeResultSuccess { /** * The type of the `TrackingConsentChangeResultSuccess` API. */ type: 'success'; } ``` ### TrackingConsentChangeResultError The returned result of an unsuccessful tracking consent preference update with a message detailing the type of error that occurred. * message A message that explains the error. This message is useful for debugging. It is \*\*not\*\* localized, and therefore should not be presented directly to the buyer. ```ts string ``` * type The type of the \`TrackingConsentChangeResultError\` API. ```ts "error" ``` ```ts export interface TrackingConsentChangeResultError { /** * The type of the `TrackingConsentChangeResultError` API. */ type: 'error'; /** * A message that explains the error. This message is useful for debugging. * It is **not** localized, and therefore should not be presented directly * to the buyer. */ message: string; } ``` ### AuthenticatedAccount * customer Provides the customer information of the authenticated customer. ```ts StatefulRemoteSubscribable ``` * purchasingCompany Provides the company info of the authenticated business customer. If the customer is not authenticated or is not a business customer, this value is \`undefined\`. ```ts StatefulRemoteSubscribable ``` ```ts export interface AuthenticatedAccount { /** * Provides the company info of the authenticated business customer. * If the customer is not authenticated or is not a business customer, this value is `undefined`. */ purchasingCompany: StatefulRemoteSubscribable; /** * Provides the customer information of the authenticated customer. */ customer: StatefulRemoteSubscribable; } ``` ### Customer Information about the authenticated customer. {% include /apps/checkout/privacy-icon.md %} Requires access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). * id Customer ID. ```ts string ``` ```ts export interface Customer { /** * Customer ID. * * @example 'gid://shopify/Customer/123' */ id: string; } ``` ### PurchasingCompany * company Include information of the company of the logged in business customer. ```ts Company ``` * location Include information of the company location of the logged in business customer. ```ts CompanyLocation ``` ```ts export interface PurchasingCompany { /** * Include information of the company of the logged in business customer. */ company: Company; /** * Include information of the company location of the logged in business customer. */ location?: CompanyLocation; } ``` ### Company * id Company ID. ```ts string ``` ```ts export interface Company { /** * Company ID. */ id: string; } ``` ### CompanyLocation * id Company location ID. ```ts string ``` ```ts export interface CompanyLocation { /** * Company location ID. */ id: string; } ``` ### CustomerPrivacy * allowedProcessing An object containing flags for each consent property denoting whether they can be processed based on visitor consent, merchant configuration, and user location. ```ts AllowedProcessing ``` * metafields Stored tracking consent metafield data. ```ts TrackingConsentMetafield[] ``` * region Details about the visitor's current location for use in evaluating if more granular consent controls should render. ```ts CustomerPrivacyRegion ``` * saleOfDataRegion Whether the visitor is in a region requiring data sale opt-outs. ```ts boolean ``` * shouldShowBanner Whether a consent banner should be displayed by default when the page loads. Use this as the initial open/expanded state of the consent banner. This is determined by the visitor's current privacy consent, the shop's \[region visibility configuration]\(https\://help.shopify.com/en/manual/privacy-and-security/privacy/customer-privacy-settings/privacy-settings#add-a-cookie-banner) settings, and the region in which the visitor is located. ```ts boolean ``` * visitorConsent An object containing the customer's current privacy consent settings. \* ```ts VisitorConsent ``` ```ts export interface CustomerPrivacy { /** * An object containing flags for each consent property denoting whether they can be processed based on visitor consent, merchant configuration, and user location. */ allowedProcessing: AllowedProcessing; /** * Stored tracking consent metafield data. * * @example `[{key: 'analyticsType', value: 'granular'}, {key: 'marketingType', value: 'granular'}]`, or `[]` */ metafields: TrackingConsentMetafield[]; /** * An object containing the customer's current privacy consent settings. * * * @example `true` — the customer has actively granted consent, `false` — the customer has actively denied consent, or `undefined` — the customer has not yet made a decision. */ visitorConsent: VisitorConsent; /** * Whether a consent banner should be displayed by default when the page loads. Use this as the initial open/expanded state of the consent banner. * * This is determined by the visitor's current privacy consent, the shop's [region visibility configuration](https://help.shopify.com/en/manual/privacy-and-security/privacy/customer-privacy-settings/privacy-settings#add-a-cookie-banner) settings, and the region in which the visitor is located. */ shouldShowBanner: boolean; /** * Whether the visitor is in a region requiring data sale opt-outs. */ saleOfDataRegion: boolean; /** * Details about the visitor's current location for use in evaluating if more granular consent controls should render. * * @example `{countryCode: 'CA', provinceCode: 'ON'}` for a visitor in Ontario, Canada; `{countryCode: 'US', provinceCode: undefined}` for a visitor in the United States if geolocation fails to detect the state; or `undefined` if neither country nor province is detected or geolocation fails. * * {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data). */ region?: CustomerPrivacyRegion; } ``` ### AllowedProcessing * analytics Can collect customer analytics about how the shop was used and interactions made on the shop. ```ts boolean ``` * marketing Can collect customer preference for marketing, attribution and targeted advertising from the merchant. ```ts boolean ``` * preferences Can collect customer preferences such as language, currency, size, and more. ```ts boolean ``` * saleOfData Can collect customer preference for sharing data with third parties, usually for behavioral advertising. ```ts boolean ``` ```ts export interface AllowedProcessing { /** * Can collect customer analytics about how the shop was used and interactions made on the shop. */ analytics: boolean; /** * Can collect customer preference for marketing, attribution and targeted advertising from the merchant. */ marketing: boolean; /** * Can collect customer preferences such as language, currency, size, and more. */ preferences: boolean; /** * Can collect customer preference for sharing data with third parties, usually for behavioral advertising. */ saleOfData: boolean; } ``` ### TrackingConsentMetafield * key The name of the metafield. It must be between 3 and 30 characters in length (inclusive). ```ts string ``` * value The information to be stored as metadata. ```ts string ``` ```ts export interface TrackingConsentMetafield { /** * The name of the metafield. It must be between 3 and 30 characters in * length (inclusive). */ key: string; /** * The information to be stored as metadata. * * @example 'any string', '', or a stringified JSON object */ value: string; } ``` ### CustomerPrivacyRegion * countryCode The \[ISO 3166 Alpha-2 format]\(https\://www\.iso.org/iso-3166-country-codes.html) for the buyer's country. {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts CountryCode ``` * provinceCode The buyer's province code, such as state, province, prefecture, or region. Province codes can be found by clicking on the \`Subdivisions assigned codes\` column for countries listed \[here]\(https\://en.wikipedia.org/wiki/ISO\_3166-2). {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to \[protected customer data]\(/docs/apps/store/data-protection/protected-customer-data). ```ts string ``` ```ts export interface CustomerPrivacyRegion { /** * The [ISO 3166 Alpha-2 format](https://www.iso.org/iso-3166-country-codes.html) for the buyer's country. * * {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data). * * @example 'CA' for Canada, 'US' for United States, 'GB' for Great Britain, or undefined if geolocation failed. */ countryCode?: CountryCode; /** * The buyer's province code, such as state, province, prefecture, or region. * * Province codes can be found by clicking on the `Subdivisions assigned codes` column for countries listed [here](https://en.wikipedia.org/wiki/ISO_3166-2). * * {% include /apps/checkout/privacy-icon.md %} Requires level 1 access to [protected customer data](/docs/apps/store/data-protection/protected-customer-data). * * @example 'ON' for Ontario, 'ENG' for England, 'CA' for California, or undefined if geolocation failed or only the country was detected. */ provinceCode?: string; } ``` ### CountryCode ```ts 'AC' | 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AN' | 'AO' | 'AR' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PS' | 'PT' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TA' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM' | 'TN' | 'TO' | 'TR' | 'TT' | 'TV' | 'TW' | 'TZ' | 'UA' | 'UG' | 'UM' | 'US' | 'UY' | 'UZ' | 'VA' | 'VC' | 'VE' | 'VG' | 'VN' | 'VU' | 'WF' | 'WS' | 'XK' | 'YE' | 'YT' | 'ZA' | 'ZM' | 'ZW' | 'ZZ' ``` ### VisitorConsent * analytics Visitor consents to recording data to understand how customers interact with the site. ```ts boolean ``` * marketing Visitor consents to ads and marketing communications based on customer interests. ```ts boolean ``` * preferences Visitor consent to remembering customer preferences, such as country or language, to personalize visits to the website. ```ts boolean ``` * saleOfData Opts the visitor out of data sharing / sales. ```ts boolean ``` ```ts export interface VisitorConsent { /** * Visitor consents to recording data to understand how customers interact with the site. */ analytics?: boolean; /** * Visitor consents to ads and marketing communications based on customer interests. */ marketing?: boolean; /** * Visitor consent to remembering customer preferences, such as country or language, to personalize visits to the website. */ preferences?: boolean; /** * Opts the visitor out of data sharing / sales. */ saleOfData?: boolean; } ``` ### Extension Meta information about an extension target. * apiVersion The API version that was set in the extension config file. ```ts ApiVersion ``` * capabilities The allowed capabilities of the extension, defined in your \[shopify.ui.extension.toml]\(/docs/api/checkout-ui-extensions/configuration) file. \* \[\`api\_access\`]\(/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. \* \[\`network\_access\`]\(/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. \* \[\`block\_progress\`]\(/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. ```ts StatefulRemoteSubscribable ``` * editor Information about the editor where the extension is being rendered. The value is undefined if the extension is not rendering in an editor. ```ts Editor ``` * rendered Whether your extension is currently rendered to the screen. Shopify might render your extension before it's visible in the UI, typically to pre-render extensions that will appear on a later step of the checkout. Your extension might also continue to run after the buyer has navigated away from where it was rendered. The extension continues running so that your extension is immediately available to render if the buyer navigates back. ```ts StatefulRemoteSubscribable ``` * scriptUrl The URL to the script that started the extension target. ```ts string ``` * target The identifier that specifies where in Shopify’s UI your code is being injected. This will be one of the targets you have included in your extension’s configuration file. ```ts Target ``` * version The published version of the running extension target. For unpublished extensions, the value is \`undefined\`. ```ts string ``` ```ts export interface Extension { /** * The API version that was set in the extension config file. * * @example '2023-04', '2023-07' */ apiVersion: ApiVersion; /** * The allowed capabilities of the extension, defined * in your [shopify.ui.extension.toml](/docs/api/checkout-ui-extensions/configuration) file. * * * [`api_access`](/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. * * * [`network_access`](/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. * * * [`block_progress`](/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. */ capabilities: StatefulRemoteSubscribable; /** * Information about the editor where the extension is being rendered. * * The value is undefined if the extension is not rendering in an editor. */ editor?: Editor; /** * Whether your extension is currently rendered to the screen. * * Shopify might render your extension before it's visible in the UI, * typically to pre-render extensions that will appear on a later step of the * checkout. * * Your extension might also continue to run after the buyer has navigated away * from where it was rendered. The extension continues running so that * your extension is immediately available to render if the buyer navigates back. */ rendered: StatefulRemoteSubscribable; /** * The URL to the script that started the extension target. */ scriptUrl: string; /** * The identifier that specifies where in Shopify’s UI your code is being * injected. This will be one of the targets you have included in your * extension’s configuration file. * * @example 'customer-account.order-status.block.render' * @see /docs/api/checkout-ui-extensions/unstable/extension-targets-overview * @see /docs/apps/app-extensions/configuration#targets */ target: Target; /** * The published version of the running extension target. * * For unpublished extensions, the value is `undefined`. * * @example 3.0.10 */ version?: string; } ``` ### ApiVersion Union of supported API versions ```ts '2023-04' | '2023-07' | '2023-10' | '2024-01' | '2024-04' | '2024-07' | '2024-10' | '2025-01' | '2025-04' | 'unstable' ``` ### Capability The capabilities an extension has access to. \* \[\`api\_access\`]\(/docs/api/checkout-ui-extensions/configuration#api-access): the extension can access the Storefront API. \* \[\`network\_access\`]\(/docs/api/checkout-ui-extensions/configuration#network-access): the extension can make external network calls. \* \[\`block\_progress\`]\(/docs/api/checkout-ui-extensions/configuration#block-progress): the extension can block a buyer's progress and the merchant has allowed this blocking behavior. \* \[\`collect\_buyer\_consent.sms\_marketing\`]\(/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can collect buyer consent for SMS marketing. \* \[\`collect\_buyer\_consent.customer\_privacy\`]\(/docs/api/checkout-ui-extensions/configuration#collect-buyer-consent): the extension can register buyer consent decisions that will be honored on Shopify-managed services. \* \[\`iframe.sources\`]\(/docs/api/checkout-ui-extensions/configuration#iframe): the extension can embed an external URL in an iframe. ```ts 'api_access' | 'network_access' | 'block_progress' | 'collect_buyer_consent.sms_marketing' | 'collect_buyer_consent.customer_privacy' | 'iframe.sources' ``` ### Editor * type Indicates whether the extension is rendering in the checkout editor. ```ts "checkout" ``` ```ts export interface Editor { /** * Indicates whether the extension is rendering in the checkout editor. */ type: 'checkout'; } ``` ### I18n * formatCurrency Returns a localized currency value. This function behaves like the standard \`Intl.NumberFormat()\` with a style of \`currency\` applied. It uses the buyer's locale by default. ```ts (number: number | bigint, options?: { inExtensionLocale?: boolean; } & NumberFormatOptions) => string ``` * formatDate Returns a localized date value. This function behaves like the standard \`Intl.DateTimeFormatOptions()\` and uses the buyer's locale by default. Formatting options can be passed in as options. ```ts (date: Date, options?: { inExtensionLocale?: boolean; } & DateTimeFormatOptions) => string ``` * formatNumber Returns a localized number. This function behaves like the standard \`Intl.NumberFormat()\` with a style of \`decimal\` applied. It uses the buyer's locale by default. ```ts (number: number | bigint, options?: { inExtensionLocale?: boolean; } & NumberFormatOptions) => string ``` * translate Returns translated content in the buyer's locale, as supported by the extension. - \`options.count\` is a special numeric value used in pluralization. - The other option keys and values are treated as replacements for interpolation. - If the replacements are all primitives, then \`translate()\` returns a single string. - If replacements contain UI components, then \`translate()\` returns an array of elements. ```ts I18nTranslate ``` ```ts export interface I18n { /** * Returns a localized number. * * This function behaves like the standard `Intl.NumberFormat()` * with a style of `decimal` applied. It uses the buyer's locale by default. * * @param options.inExtensionLocale - if true, use the extension's locale */ formatNumber: ( number: number | bigint, options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions, ) => string; /** * Returns a localized currency value. * * This function behaves like the standard `Intl.NumberFormat()` * with a style of `currency` applied. It uses the buyer's locale by default. * * @param options.inExtensionLocale - if true, use the extension's locale */ formatCurrency: ( number: number | bigint, options?: {inExtensionLocale?: boolean} & Intl.NumberFormatOptions, ) => string; /** * Returns a localized date value. * * This function behaves like the standard `Intl.DateTimeFormatOptions()` and uses * the buyer's locale by default. Formatting options can be passed in as * options. * * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat0 * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options * * @param options.inExtensionLocale - if true, use the extension's locale */ formatDate: ( date: Date, options?: {inExtensionLocale?: boolean} & Intl.DateTimeFormatOptions, ) => string; /** * Returns translated content in the buyer's locale, * as supported by the extension. * * - `options.count` is a special numeric value used in pluralization. * - The other option keys and values are treated as replacements for interpolation. * - If the replacements are all primitives, then `translate()` returns a single string. * - If replacements contain UI components, then `translate()` returns an array of elements. */ translate: I18nTranslate; } ``` ### I18nTranslate This defines the i18n.translate() signature. ```ts export interface I18nTranslate { /** * This returns a translated string matching a key in a locale file. * * @example translate("banner.title") */ ( key: string, options?: {[placeholderKey: string]: ReplacementType | string | number}, ): ReplacementType extends string | number ? string : (string | ReplacementType)[]; } ``` ### Localization * country The country context of the buyer sees in the customer account. It will update if the buyer changes the country in the customer account If the country is unknown, then the value is undefined. ```ts StatefulRemoteSubscribable ``` * extensionLanguage This is the buyer's language, as supported by the extension. If the buyer's actual language is not supported by the extension, this is the fallback locale used for translations. For example, if the buyer's language is 'fr-CA' but your extension only supports translations for 'fr', then the \`isoCode\` for this language is 'fr'. If your extension does not provide french translations at all, this value is the default locale for your extension (that is, the one matching your .default.json file). ```ts StatefulRemoteSubscribable ``` * language The language the buyer sees in the customer account hub. ```ts StatefulRemoteSubscribable ``` ```ts export interface Localization { /** * The language the buyer sees in the customer account hub. */ language: StatefulRemoteSubscribable; /** * This is the buyer's language, as supported by the extension. * If the buyer's actual language is not supported by the extension, * this is the fallback locale used for translations. * * For example, if the buyer's language is 'fr-CA' but your extension * only supports translations for 'fr', then the `isoCode` for this * language is 'fr'. If your extension does not provide french * translations at all, this value is the default locale for your * extension (that is, the one matching your .default.json file). */ extensionLanguage: StatefulRemoteSubscribable; /** * The country context of the buyer sees in the customer account. * It will update if the buyer changes the country in the customer account * If the country is unknown, then the value is undefined. */ country: StatefulRemoteSubscribable; } ``` ### Country * isoCode The ISO-3166-1 code for this country. ```ts CountryCode ``` ```ts export interface Country { /** * The ISO-3166-1 code for this country. * @see https://www.iso.org/iso-3166-country-codes.html */ isoCode: CountryCode; } ``` ### Language * isoCode The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code. ```ts string ``` ```ts export interface Language { /** * The BCP-47 language tag. It may contain a dash followed by an ISO 3166-1 alpha-2 region code. * * @example 'en' for English, or 'en-US' for English local to United States. * @see https://en.wikipedia.org/wiki/IETF_language_tag * @see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 */ isoCode: string; } ``` ### StandardExtensionNavigation * navigate The navigate() method navigates to a specific URL, updating any provided state in the history entries list. ```ts NavigateFunction ``` ```ts export interface StandardExtensionNavigation { /** * The navigate() method navigates to a specific URL, updating any provided state in the history entries list. */ navigate: NavigateFunction; } ``` ### NavigateFunction ```ts export interface NavigateFunction { /** * Navigates to a specific URL, updating any provided state in the history entries list. * @param url The destination URL to navigate to. */ (url: string, options?: NavigationOptions): void; } ``` ### StorefrontApiVersion Union of supported storefront API versions ```ts '2022-04' | '2022-07' | '2022-10' | '2023-01' | '2023-04' | '2023-07' | '2024-01' | '2024-04' | '2024-07' | '2024-10' | '2025-01' | '2025-04' | 'unstable' ``` ### GraphQLError GraphQL error returned by the Shopify Storefront APIs. * extensions ```ts { requestId: string; code: string; } ``` * message ```ts string ``` ```ts export interface GraphQLError { message: string; extensions: { requestId: string; code: string; }; } ``` ### SessionToken * get Requests a session token that hasn't expired. You should call this method every time you need to make a request to your backend in order to get a valid token. This method will return cached tokens when possible, so you don’t need to worry about storing these tokens yourself. ```ts () => Promise ``` ```ts export interface SessionToken { /** * Requests a session token that hasn't expired. You should call this method every * time you need to make a request to your backend in order to get a valid token. * This method will return cached tokens when possible, so you don’t need to worry * about storing these tokens yourself. */ get(): Promise; } ``` ### ExtensionSettings The merchant-defined setting values for the extension. * \[key: string] ```ts string | number | boolean | undefined ``` ```ts export interface ExtensionSettings { [key: string]: string | number | boolean | undefined; } ``` ### Storage A key-value storage object for extension targets. Stored data is only available to this specific app but can be shared across multiple extension targets. The storage backend is implemented with \`localStorage\` and should persist for ... days However, data persistence isn't guaranteed. * delete Delete stored data by key. ```ts (key: string) => Promise ``` * read Read and return a stored value by key. The stored data is deserialized from JSON and returned as its original primitive. Returns \`null\` if no stored data exists. ```ts (key: string) => Promise ``` * write Write stored data for this key. The data must be serializable to JSON. ```ts (key: string, data: any) => Promise ``` ```ts export interface Storage { /** * Read and return a stored value by key. * * The stored data is deserialized from JSON and returned as * its original primitive. * * Returns `null` if no stored data exists. */ read(key: string): Promise; /** * Write stored data for this key. * * The data must be serializable to JSON. */ write(key: string, data: any): Promise; /** * Delete stored data by key. */ delete(key: string): Promise; } ``` ### Ui * forceDataRefresh Refresh data so the surrounding information on the page is updated. The \`content\` string will appear in a toast message after refresh, to confirm the action was successful. To request access to this API: 1. Go to your partner dashboard and click \*\*Apps\*\*. 2. Select the app you need to request access for. 3. Click \*\*API access\*\*. 4. Under \*\*Access force data refresh\*\*, click \*\*Request access\*\*. ```ts (content: string) => Promise ``` * overlay An overlay is a contextual element on top of the main interface that provides additional information or functionality. ```ts { close(overlayId: string): void; } ``` * toast The Toast API displays a non-disruptive message that displays at the bottom of the interface to provide quick, at-a-glance feedback on the outcome of an action. How to use: - Use toasts to confirm successful actions. - Aim for two words. - Use noun + past tense verb format. For example, \\\`Changes saved\\\`. For errors, or information that needs to persist on the page, use a \[banner]\(/docs/api/checkout-ui-extensions/unstable/components/feedback/banner) component. ```ts { show(content: string): void; } ``` ```ts export interface Ui { /** * An overlay is a contextual element on top of the main interface that provides additional information or functionality. */ overlay: { close(overlayId: string): void; }; /** * The Toast API displays a non-disruptive message that displays at the bottom * of the interface to provide quick, at-a-glance feedback on the outcome * of an action. * * How to use: * * - Use toasts to confirm successful actions. * * - Aim for two words. * * - Use noun + past tense verb format. For example, \`Changes saved\`. * * For errors, or information that needs to persist on the page, use a [banner](/docs/api/checkout-ui-extensions/unstable/components/feedback/banner) component. */ toast: { show(content: string): void; }; /** * Refresh data so the surrounding information on the page is updated. The `content` string will appear in a toast message after refresh, to confirm the action was successful. * * To request access to this API: * * 1. Go to your partner dashboard and click **Apps**. * * 2. Select the app you need to request access for. * * 3. Click **API access**. * * 4. Under **Access force data refresh**, click **Request access**. */ forceDataRefresh(content: string): Promise; } ``` ### Examples * #### Customer account wishlist full-page extension example ##### React ```jsx import { reactExtension, Text, BlockStack, ResourceItem, Image, Heading, Page, Grid, GridItem, } from '@shopify/ui-extensions-react/customer-account'; import React from 'react'; import { useEffect, useState } from 'react'; export default reactExtension( 'customer-account.page.render', () => , ); interface Wishlist { id: string; items: { productId: string; productLink: string; productImage: string; label: string; }[]; } function Wishlists() { const [wishlists, setWishlists] = useState< Wishlist[] >(); const [loading, setLoading] = useState(true); useEffect(() => { async function fetchWishlists() { setLoading(true); const response = await fetch( `https://your-backend.com/api/wishlists`, ); const wishlists = await response.json(); setLoading(false); setWishlists(wishlists); } void fetchWishlists(); }, []); if (loading) { return Loading...; } if (!wishlists) { return ; } return ( {wishlists.map((item) => { return ( {item.items[0].label} ); })} ); } function NotFound() { return ( Resource Not found ); } ``` ##### Javascript ```js import {BlockStack, ResourceItem, extension, Image, Page, Card, Grid, GridItem} from '@shopify/ui-extensions/customer-account'; export default extension( 'customer-account.page.render', async (root) => { const response = await fetch( `https://your-backend.com/api/wishlists`, ); const wishlists = await response.json(); const app = root.createComponent( Grid, { columns: 250, rows: 'auto', spacing: 'base', blockAlignment: 'center' } ); wishlists.forEach((wishlist) => { const gridItem = root.createComponent(GridItem, { columnSpan: 1, }); const wishlistItem = root.createComponent(ResourceItem, { to: `/wishlist/${wishlist.id}`, }) const image = root.createComponent(Image, { source: wishlist.items[0].productImage }) const text = root.createText(wishlist.items[0].label) const contentWrapper = root.createComponent(BlockStack) contentWrapper.append(image); contentWrapper.append(text); wishlistItem.append(contentWrapper); gridItem.append(wishlistItem); app.append(gridItem); }) const page = root.createComponent(Page, { title: 'Wishlists', }) page.append(app); root.append(page); }, ); ```