> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tryflowy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Flowy is a node-based AI creative platform: you generate images, video, audio, 3D and vector on an infinite Canvas, refine on the Studio timeline, and export or publish from the same project.
> Prefer the Flowy MCP server (https://mcp.tryflowy.ai/mcp) or the REST API at https://apis.tryflowy.ai/v1 for programmatic work. Install with `flowy mcp install` from the @flowy/cli package.
> Credits are workspace-scoped. Generations reserve credits on start and only deduct on success, so failed runs refund automatically.

# Identity Handoff

> Link to Flowy with the visitor's PostHog ids so one journey stays one person in analytics across domains.

Cookies don't cross top-level domains, so a visitor arriving from a campaign page or microsite on another domain would normally become a brand-new anonymous person in analytics the moment they land on `tryflowy.ai`. The identity handoff fixes that: pass the visitor's PostHog ids in the link, and Flowy continues the same journey. Once they sign up or sign in, everything they did before the click is attached to their account.

This only joins journeys **within one PostHog project**: it's for Flowy-operated pages instrumented with the same project as Flowy itself. Ids from a different project don't break anything: they just start a fresh anonymous visitor rather than continuing one.

## The parameters

| Parameter        | Value                                           | Rules                                                               |
| ---------------- | ----------------------------------------------- | ------------------------------------------------------------------- |
| `ph_distinct_id` | `posthog.get_distinct_id()` on the linking site | Up to 200 characters: letters, digits, `_` `.` `$` `-`              |
| `ph_session_id`  | `posthog.get_session_id()` (optional)           | A UUIDv7 no older than 24 hours; carries the hop inside one session |

Put them in the **hash fragment**: a fragment never reaches server logs or the `Referer` header:

```text theme={"theme":{"light":"github-light","dark":"vesper"}}
https://tryflowy.ai/#ph_distinct_id=<distinct-id>&ph_session_id=<session-id>
```

Query parameters (`?ph_distinct_id=…`) are also accepted. When both carry a value, the fragment wins.

## Decorating a link

```js theme={"theme":{"light":"github-light","dark":"vesper"}}
const url = new URL("https://tryflowy.ai/");
url.hash = new URLSearchParams({
  ph_distinct_id: posthog.get_distinct_id(),
  ph_session_id: posthog.get_session_id(),
}).toString();
// url.toString() → the decorated link
```

Skip decoration for a visitor who has declined analytics: there is no stable id worth passing. In PostHog's cookieless mode, `get_distinct_id()` returns the literal sentinel `$posthog_cookieless`; Flowy discards it on arrival.

## What happens on arrival

* The parameters are read once and immediately removed from the address bar, so they never linger in a URL that could be copied or shared.
* They take effect only for a visitor who has accepted analytics cookies on Flowy. A visitor who accepts later and then signs in has the handed-off journey merged at that point instead.
* Invalid values are discarded: wrong characters, over-long ids, session ids that aren't a fresh UUIDv7, and the `$posthog_cookieless` sentinel.
