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

# SessionKeySetupFlow

> Standalone component to trigger the session key onboarding flow.

`SessionKeySetupFlow` renders the full UI flow for setting up a session key — used when you want manual control over when setup is triggered, rather than relying on the automatic detection in `TapRailsThemeProvider`.

## Import

```ts theme={null}
import { SessionKeySetupFlow } from '@taprails/tap-to-pay';
```

## Usage

```tsx theme={null}
{showSetup && (
  <SessionKeySetupFlow
    onComplete={() => setShowSetup(false)}
    onCancel={() => setShowSetup(false)}
  />
)}
```

## Props

<ParamField path="onComplete" type="() => void">
  Called when the user successfully completes session key setup (approval signed, key registered).
</ParamField>

<ParamField path="onCancel" type="() => void">
  Called when the user cancels the setup flow.
</ParamField>

***

## When to Use

`TapRailsThemeProvider` handles setup **automatically** — you only need `SessionKeySetupFlow` directly if:

* You want to trigger setup at a specific point in your onboarding (e.g., "Enable Tap-to-Pay" button)
* You want to show setup on a custom screen rather than as an overlay
* You're not using `TapRailsThemeProvider`

See [Session Key Setup Guide](/guides/session-key-setup) for the full integration guide.
