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

# Action Codes

> Let users approve blockchain actions without connecting their wallet to your app

## What are Action Codes?

Action Codes are **short-lived, one-time codes** that let users approve blockchain actions from anywhere — without connecting their wallet to your app.

<CardGroup cols={2}>
  <Card title="For Users" icon="user">
    Generate a code in your wallet, share it, and approve requests as they come in.
  </Card>

  <Card title="For Developers" icon="code">
    Request approvals via a simple SDK. No wallet integration needed in your app.
  </Card>
</CardGroup>

## How it works

<Steps>
  <Step title="User generates a code">
    User opens [actioncode.app](https://actioncode.app) in their wallet browser and gets an 8-digit code.
  </Step>

  <Step title="User shares the code">
    User pastes the code into your app, bot, or anywhere you accept it.
  </Step>

  <Step title="You attach an action">
    Your app attaches a transaction or message to the code via the SDK.
  </Step>

  <Step title="User approves">
    User sees the request in [actioncode.app](https://actioncode.app) and signs with their wallet.
  </Step>

  <Step title="You get the result">
    Your app receives the signed transaction or message.
  </Step>
</Steps>

## See it in code

```typescript theme={null}
import { ActionCodesClient } from '@actioncodes/sdk'

const client = new ActionCodesClient({
  authToken: process.env.ACTION_CODES_TOKEN
})

// 1. User gives you their code (e.g., "48291037")
const code = userInput

// 2. Resolve the code to verify it's valid
const actionCode = await client.resolve(code)
console.log('Code belongs to wallet:', actionCode.pubkey)

// 3. Attach a transaction for them to sign
await client.attachTransaction(code, serializedTransaction)

// 4. Wait for user to approve in their wallet
for await (const status of client.observeStatus(code)) {
  if (status.finalizedSignature) {
    console.log('Approved! Signature:', status.finalizedSignature)
    break
  }
}
```

<Note>
  **Need an auth token?** Request one by DMing [@beharefe](https://t.me/beharefe) on Telegram or emailing [gm@actioncodes.org](mailto:gm@actioncodes.org).
</Note>

<Tip>
  **Where do users get codes?** Users visit [actioncode.app](https://actioncode.app) in their Solana wallet's browser (like Phantom or Solflare), connect their wallet, and get a code. The code is valid for about 2 minutes.
</Tip>

## When to use Action Codes

| Use Case               | How it works                                                         |
| ---------------------- | -------------------------------------------------------------------- |
| **Chat bots**          | User sends code to bot, bot attaches action, user approves in wallet |
| **Embedded apps**      | No wallet extension needed — just accept a code                      |
| **Cross-device**       | Start on desktop, approve on mobile wallet                           |
| **Backend services**   | Server requests approval, user approves asynchronously               |
| **Telegram / Discord** | Bots can request signatures without OAuth or deep links              |

## What it replaces

| Traditional Approach       | With Action Codes    |
| -------------------------- | -------------------- |
| Wallet connect modals      | User enters 8 digits |
| OAuth redirects            | No redirects needed  |
| QR code scanning           | Just type a code     |
| Deep links (break easily)  | Works everywhere     |
| Browser extension required | No extension needed  |

## Get started

<CardGroup cols={2}>
  <Card title="Quick Start" href="/quickstart" icon="rocket">
    Integrate in 5 minutes with our SDK
  </Card>

  <Card title="How It Works" href="/how-it-works" icon="circle-info">
    Understand the flow in detail
  </Card>

  <Card title="Playground" href="/playground" icon="play">
    Try it hands-on with live demos
  </Card>

  <Card title="API Reference" href="/sdk/methods" icon="book">
    Full SDK method documentation
  </Card>
</CardGroup>

***

<Info>
  **Action Codes Protocol** is open-source (Apache-2.0).

  Won 4th place in infrastructure track at [Colosseum Breakout Hackathon](https://arena.colosseum.org/projects/explore/one-time-action-codes-1).

  For integrations or support, contact [gm@actioncodes.org](mailto:gm@actioncodes.org) or DM [@beharefe](https://t.me/beharefe) on Telegram.
</Info>
