FLOWDocs

Guest sessions

Start using Flow without signing up and keep your identity when you create an account.

A guest session gives you an automatically generated username and a Flow identity without a signup form. Apps that enable guests can attach progress to that identity immediately, including XP.

Keep your progress

Create an account from the app while your guest session is still active. The signup flow can upgrade that guest in place, keeping the same user ID and the data attached to it. In the email signup flow, verify your email and optionally add a passkey. An email-only account is a full account; you can add a passkey later in Flow ID's account security settings.

Signing in to a different existing account switches accounts. It does not merge your guest progress into that account.

Guest sessions depend on the browser's cookies. Clearing them can abandon the guest identity, and a guest has no email or passkey to recover it with. Create an account before clearing browser data or moving to another device.

Guest data is best-effort storage. Deployments can enable age-based cleanup of accounts that have not upgraded; a browser cookie does not guarantee indefinite retention. Upgrade while the guest account is still available.

What guests can do

Guests have a real session and can earn progress and enter accessible rooms. They cannot create or own rooms or become room moderators. Individual apps and rooms may restrict other actions, such as posting messages.

A guest has no wallet address or passkey for signing. Creating a full account without adding a passkey does not by itself enable signing either.

Enable guests in your app

Install @flow-industries/id and configure your app's same-origin /flow/session handler and registered origin using the integration setup. Initialize the SDK in the browser:

import { createFlow } from "@flow-industries/id";

const flow = createFlow({ autoGuest: true });

autoGuest defaults to false. When enabled, the SDK tries to restore a session before creating a guest. Initialization is asynchronous; subscribe to state changes or use the React hooks instead of assuming a user exists immediately.

For an explicit action, await flow.ensureGuest() restores or creates a session. Concurrent calls share one operation, and the result is true when a session is active. Handle a false result or a rejected request in your UI; creation is rate-limited.

Start signup from a user action:

createAccountButton.addEventListener("click", () => {
  void flow.login({ signUp: true }).catch(showSignInError);
});

Here createAccountButton and showSignInError are supplied by your app. login() starts navigation to Flow ID. Read the restored session when the app loads again; do not run a protected action after await flow.login() expecting signup to have finished.

The session handler proves the current guest session during this handoff. Do not send a user ID or a guest token in a URL to select an account to upgrade.

Identify guests correctly

Use user.id (the verified JWT's sub) as your data key. It survives an in-place upgrade. A username can change, and a wallet address may be absent even for a full account.

In React, useFlowId() exposes user, isAuthenticated, and isGuest. isAuthenticated is true for guests. Use both isAuthenticated && !isGuest when presenting actions that require a full account.

Enforce the same rule on your server: after verifying the token and its audience, require the JWT's guest claim to be exactly false for full-account privileges. Treat a missing claim as insufficient authorization. UI checks alone do not protect an endpoint.

The first-party refresh cookie rotates and lasts 30 days. With autoGuest enabled, a successful logout starts a fresh guest; otherwise the app stays signed out. Neither behavior transfers the previous guest's data.

On this page