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-navigator initial-screen-name="CustomerApi">
<s-screen name="CustomerApi" title="Customer Api">
<s-scroll-box>
<s-text>Customer ID: {shopify.customer.id}</s-text>
</s-scroll-box>
</s-screen>
</s-navigator>
);
};
Examples
Retrieve the ID of the customer.
jsx
import {render} from 'preact'; export default async () => { render(<Extension />, document.body); }; const Extension = () => { return ( <s-navigator initial-screen-name="CustomerApi"> <s-screen name="CustomerApi" title="Customer Api"> <s-scroll-box> <s-text>Customer ID: {shopify.customer.id}</s-text> </s-scroll-box> </s-screen> </s-navigator> ); };