Customer APIAPIs
APIs
The customer API provides an extension with data about the current customer.
Supporting targets
Anchor to customerapiCustomerApi
- numberrequired
The unique identifier for the customer
Was this section helpful?
Anchor to examplesExamples
Examples of using the Customer API.
Anchor to example-retrieve-the-id-of-the-customer.Retrieve the ID of the customer.
Was this section helpful?
Retrieve the ID of the customer.
jsx
import {render} from 'preact';
export default async () => {
render(<Extension />, document.body);
};
const Extension = () => {
return (
<s-page heading='Customer Api'>
<s-scroll-box>
<s-text>Customer ID: {shopify.customer.id}</s-text>
</s-scroll-box>
</s-page>
);
};
Examples
Retrieve the ID of the customer.
jsx
import {render} from 'preact'; export default async () => { render(<Extension />, document.body); }; const Extension = () => { return ( <s-page heading='Customer Api'> <s-scroll-box> <s-text>Customer ID: {shopify.customer.id}</s-text> </s-scroll-box> </s-page> ); };