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

# Quickstart

> Get Toffee running on your site in 2 minutes.

<Tabs>
  <Tab title="Existing Project">
    ## 1. Create a site

    Sign up at [db.toffee.at](https://db.toffee.at), create a team, and add a site. You'll get an API key that starts with `ar_`.

    <Warning>Save your API key immediately. It is shown only once and cannot be retrieved later.</Warning>

    ## 2. Install the SDK

    ```bash theme={null}
    npm install @agent-radar/sdk
    ```

    ## 3. Initialize

    **React / Next.js (App Router):**

    ```tsx theme={null}
    'use client';
    import { useEffect, useRef } from 'react';
    import { init } from '@agent-radar/sdk';

    export function ToffeeProvider() {
      const initialized = useRef(false);
      useEffect(() => {
        if (initialized.current) return;
        initialized.current = true;
        const toffee = init({
          siteId: 'YOUR_SITE_ID',
          apiKey: 'ar_YOUR_KEY',
          endpoint: 'https://api.toffee.at/api/v1/events',
          onDetection: (result) => {
            console.log(result.classification.classification); // 'human' | 'bot' | 'agent'
            console.log(result.riskTier);
            console.log(result.probability);
          },
        });
        return () => { toffee.destroy(); initialized.current = false; };
      }, []);
      return null;
    }
    ```

    Mount in your root layout:

    ```tsx theme={null}
    // app/layout.tsx
    <body>{children}<ToffeeProvider /></body>
    ```

    **Vue:**

    ```vue theme={null}
    <script setup>
    import { onMounted, onUnmounted } from 'vue';
    import { init } from '@agent-radar/sdk';
    let toffee;
    onMounted(() => { toffee = init({ siteId: '...', apiKey: 'ar_...', endpoint: '...' }); });
    onUnmounted(() => toffee?.destroy());
    </script>
    ```

    **Script tag:**

    ```html theme={null}
    <script src="https://cdn.toffee.at/sdk.js"></script>
    <script>
      AgentRadar.init({ siteId: '...', apiKey: 'ar_...', endpoint: '...' });
    </script>
    ```

    ## 4. View your dashboard

    Open your dashboard at [db.toffee.at](https://db.toffee.at). Visit your site in another tab — you should see the visit appear within seconds.
  </Tab>

  <Tab title="Agent Skill">
    Install the Toffee agent skill to let your AI coding agent handle integration for you:

    ```bash theme={null}
    npx skills add VishiATChoudhary/toffee-skills@toffee-integration
    ```

    Or install globally:

    ```bash theme={null}
    npx skills add VishiATChoudhary/toffee-skills@toffee-integration -g -y
    ```

    Once installed, your agent can guide you through the full setup — npm install, framework-specific initialization, tracking pixel, element tracking, and common mistakes.

    Learn more at [skills.sh](https://skills.sh).
  </Tab>
</Tabs>

## Next steps

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/sdk/installation">
    npm install, framework guides, and the tracking pixel.
  </Card>

  <Card title="Configuration" icon="gear" href="/sdk/configuration">
    Customize detection callbacks, tracking options, and more.
  </Card>

  <Card title="Detection" icon="shield" href="/sdk/detection">
    Learn how Toffee classifies visitors as human or agent.
  </Card>

  <Card title="API Reference" icon="server" href="/api/overview">
    Query your detection data programmatically.
  </Card>
</CardGroup>
