> For the complete documentation index, see [llms.txt](https://help.pixfizz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pixfizz.com/ecommerce/user-identity-anonymous-and-connected-users.md).

# User Identity: Anonymous and Connected Users

Pixfizz fully supports both anonymous (not logged in) and connected (logged in) users. This article explains how user identity works across the platform, how data is preserved when a user logs in or registers, and what this means for each deployment type.

***

### How User Identity Works

In Pixfizz, a user always exists. Even before a visitor logs in or registers, the platform creates an anonymous user identity tied to their browser session. This means:

* An anonymous user can browse products, upload photos, create projects (designs), and add items to their cart — just like a logged-in user.
* All objects created during an anonymous session (projects, cart contents, galleries) are owned by that anonymous identity.
* Nothing is lost or temporary. The anonymous user's data persists for the duration of their browser session.

***

### What Happens at Login or Registration

When an anonymous user logs in or registers from the same browser, Pixfizz automatically transfers their session data to the authenticated account:

* **Registration:** the anonymous user converts into a new registered user. All projects, cart contents, and galleries carry over seamlessly.
* **Login (existing account):** the anonymous user's data — projects, cart contents, galleries — is transferred to the existing registered account.

This transfer is handled automatically by the platform. There is no additional configuration required.

#### What this means in practice

A typical shopper flow looks like this:

1. Visitor arrives at your store (anonymous user is created behind the scenes).
2. They browse products, open the design tool, and create a personalized project.
3. They add the project to their cart.
4. At checkout (or at any earlier point), they log in or create an account.
5. Their project and cart contents are already there — nothing is lost.

***

### Deployment-Specific Notes

#### Full Pixfizz (Shopper / CMS storefront)

The anonymous-to-connected flow works out of the box. The Shopper template handles login, registration, cart, and project ownership natively. No additional integration work is needed.

#### Shopify + Pixfizz

Shopify manages the storefront, cart, and user accounts. Pixfizz manages personalization and project storage. The anonymous user identity on the Pixfizz side is separate from the Shopify session, but the Pixfizz JavaScript SDK (`Pixfizz.createProject`, `Pixfizz.openProject`) handles session continuity automatically within the same browser.

#### Custom eCommerce Integration (API)

If you manage your own storefront and use the Pixfizz API, the anonymous user lifecycle still applies on the Pixfizz side. However, you are responsible for connecting your user identity to Pixfizz using the **User Handoff** endpoint:

```
POST /v1/users/_uid/<external-source>/<external-user-id>.json
```

This endpoint creates or synchronises a user in Pixfizz and logs them in. When called from the same browser where an anonymous session exists, the platform transfers the anonymous user's projects and data to the identified user.

**Key recommendations:**

* Call the handoff endpoint immediately after the user logs into your site, and before any interaction with the Pixfizz API.
* For the best experience, also call it in the background on every page load when the user is logged in.
* Call `DELETE /v1/session.json` when the user logs out of your site.

For full details on the handoff endpoint, including authentication hash calculation and example code, see your integration documentation.

***

### Guest Checkout

> Relevant to Full Pixfizz deployments only.

If a user checks out without registering, Pixfizz creates a **guest user** record. Guest users:

* Own their orders, projects, and galleries.
* Can receive order confirmation and shipping emails.
* Cannot log in or reset a password.

Guest users can be merged into a registered account later by an admin, transferring all associated data.

***

### Summary

| Scenario                                    | What happens                                                             |
| ------------------------------------------- | ------------------------------------------------------------------------ |
| Anonymous user browses and creates projects | All data is owned by the anonymous session                               |
| Anonymous user registers                    | Anonymous user converts to registered user; all data carries over        |
| Anonymous user logs into existing account   | Anonymous user's data transfers to the existing account                  |
| Guest checkout (Pixfizz eCommerce only)     | A guest user record is created; data is preserved but user cannot log in |
| Admin merges guest into registered user     | All guest data transfers to the registered account                       |
