Customer identity
Without identity, every Customiser session is anonymous: designs work, cart editing works, but a design belongs to the browser session that made it. With identity, designs and uploaded images follow your logged-in customer — across devices, across visits.
Identity is a claim your server makes about who is logged in. It can never come from the browser: if a page could name its own customer, any visitor could claim any customer's designs.
1. Your server mints a customer token
While rendering a product page for a logged-in customer, call:
POSThttps://api.idealfactory.com/v1/shop/customer-tokens
{ "external_ref": "your-customer-id-123" }
curl -X POST https://api.idealfactory.com/v1/shop/customer-tokens \
-H "Authorization: Bearer $IF_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"external_ref":"your-customer-id-123"}'
Response:
{ "data": { "customer_token": "…", "expires_at": "…" } }
external_ref is your customer identifier — any stable string. We store
only a hash of it. Tokens live 12 hours and are single-shop: one minted for
your store cannot be replayed against another.
2. Your page adds it to the snippet
<div data-idealfactory-customiser
data-embed-key="ek_your_key_here"
data-sku="YOUR_PRODUCT_SKU"
data-customer-token="{{ tokenFromYourServer }}"
style="position: fixed; inset: 0;"></div>
That's the entire integration: one server call, one extra attribute.
Logged-out visitors simply omit data-customer-token and design
anonymously.
Ownership rules you get automatically
- Same customer, any device: sessions minted with the same
external_refare the same identity — their designs and uploads carry over. - Design-before-login: a customer who designs anonymously and then logs in keeps the design — the first identified save adopts it (and the images it uses) onto their identity.
- Account switch on a shared device: if customer B's session cites a design belonging to customer A, the request is refused with a 422 rather than mixing their design histories. Treat it as a stale cart line.
- Uploaded images on anonymous sessions are kept for 30 days; images owned by an identified customer are kept indefinitely.
Shopify / hosted platforms
Minting a customer token requires a server, which a themed Shopify store doesn't have — identity there arrives with the IdealFactory Shopify app (which mints the token through Shopify's own signed App Proxy). Until then, Shopify integrations run design + orders with anonymous designing; the design-before-login adoption above means nothing is lost when identity is added later.