Skip to main content

Authenticated Account

The API for interacting with an account in which the customer is fully authenticated.

The base API object provided to this and other customer-account extension targets.

Anchor to authenticatedAccount
authenticatedAccount
required

Information about the authenticated account.

Examples
import '@shopify/ui-extensions/preact';
import {render} from 'preact';

export default async () => {
render(<Extension />, document.body);
};

function Extension() {
const orderStatusCustomerId =
shopify.authenticatedAccount.customer.value
.id;
const authenticatedCustomerId =
shopify.authenticatedAccount.customer.value
.id;

if (
authenticatedCustomerId &&
orderStatusCustomerId?.endsWith(
authenticatedCustomerId,
)
) {
return (
<s-banner>
<s-link href="extension:manageLoyaltyPoints/">
{shopify.i18n.translate(
'manageLoyaltyPoints',
)}
</s-link>
</s-banner>
);
}
return null;
}
Was this page helpful?