Skip to main content

Customer account UI extensions

Customer account UI extensions let app developers build custom functionality that merchants can install at defined points on the Order index, Order status, and Profile pages in customer accounts.

Shopify Plus

Some static extensions on the Profile page only render for B2B customers. B2B on Shopify is only available on the Shopify Plus plan. See B2B Profile targets

Anchor to scaffolding-extensionScaffolding an extension

Use Shopify CLI to generate a new extension in the directory of your app.

Scaffolding

npm init @shopify/app@latest
cd your-app
npm run shopify app generate extension

Extension targets provide locations for customer account UI extensions to appear.

Extension UIs are rendered using remote UI, a fast and secure environment for custom (non-DOM) UIs.

Extension targets

import {
reactExtension,
Banner,
useTranslate,
} from '@shopify/ui-extensions-react/customer-account';

reactExtension('customer-account.order-index.block.render', () => (
<App />
));

function App() {
const translate = useTranslate();
return <Banner>{translate('welcomeMessage')}</Banner>;
}

The Profile page with a purple dotted-line box above the page title that says "Extension targets".

When you create a customer account UI extension, the shopify.extension.toml file is automatically generated in your customer account UI extension directory. It contains the extension's configuration, which includes the extension name, extension targets, metafields, capabilities and settings definition.

Shopify.ui.extension.example.toml

toml

api_version = "unstable"

[[extensions]]
name = "My customer account ui extension"
handle = "customer-account-ui"
type = "ui_extension"

[[extensions.targeting]]
target = "customer-account.order-status.block.render"
module = "./Extension.jsx"

APIs enable customer account UI extensions to get information about the customer or related objects and to perform actions. For example, you can use APIs to retrieve previous orders of the customer so that you can offer related products as upsells.

Extensions use JavaScript to read and write data and call external services, and natively render UIs built using Shopify's checkout and customer account components.

Extension APIs

import {
reactExtension,
Banner,
useTranslate,
} from '@shopify/ui-extensions-react/customer-account';

reactExtension(
'customer-account.order-status.block.render',
() => <App />,
);

function App() {
const translate = useTranslate();
return <Banner>{translate('welcomeMessage')}</Banner>;
}

Customer account UI extensions declare their interface using supported UI components. Shopify renders the UI natively so it's performant, accessible, and works in all of customer account supported browsers.

Components are designed to be flexible, enabling you to layer and mix them to create highly-customized app extensions that feel seamless within the customer account experience. All components that will inherit a merchant's brand settings and the CSS cannot be altered or overridden.

To build customer account UI extensions, you can use checkout components, and customer account components.

UI components

import {
reactExtension,
BlockStack,
InlineStack,
Button,
Image,
Text,
} from '@shopify/ui-extensions-react/customer-account';

reactExtension(
'customer-account.order-status.block.render',
() => <App />,
);

function App() {
return (
<InlineStack>
<Image source="/url/for/image" />
<BlockStack>
<Text size="large">Heading</Text>
<Text size="small">Description</Text>
</BlockStack>
<Button
onPress={() => {
console.log('button was pressed');
}}
>
Button
</Button>
</InlineStack>
);
}

An animation of a card that contains an image, heading, description, and button, shifting and transforming into highly customized versions of the same UI to reflect each merchant's unique branding.

Custom protocols make it easier to navigate to common locations, and construct URLs.

Use the shopify:customer-account protocol when you want to construct a URL with a root of customer accounts.

Relative URLs are relative to your extension and are useful when you want to link to a route in your extension.

Triggers a navigation to an extension using the extension: protocol. The handle is the handle of the extension that will be navigated to in the same application. Build a full-page extension to create a new page in customer accounts and handle the navigation.

Shopify:customer-account

Customer account UI extensions are a safe and secure way to customize the appearance and functionality of the customer account pages without compromising the security of customer data.

  • They run in an isolated sandbox, separate from the customer account page and other UI extensions.
  • They don't have access to sensitive payment information or the customer account page itself (HTML or other assets).
  • They are limited to specific UI components and APIs that are exposed by the platform.
  • They have limited access to global web APIs.
  • Apps that wish to access protected customer data, must submit an application and are subject to strict security guidelines and review proccesses by Shopify.
Constraints

You can't override the CSS for UI components. The customer account UI extension will always render the merchant's own branding as shown in the image in the UI components section above.

Customer account UI extensions don't have access to the DOM and can't return DOM nodes. They can't return <div> elements, for example. Building an arbitrary tree of HTML and loading additional scripts using script tags are also not supported.

Find an end-to-end guide to testing your extensions in Testing customer account UI extensions.