IdealFactory Developer Docs

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

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.