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

# Developers overview

> Every way to build on SiteGPT: widget SDK, tracking events, webhooks, the Agent API, the CLI, and MCP.

SiteGPT has a developer surface for each direction of integration: control
the widget on your page, get events out, and drive the platform
programmatically.

## Pick your path

<CardGroup cols={2}>
  <Card title="JavaScript SDK" icon="js" href="/docs/developers/sdk">
    Control the widget from your page: open and close it, send messages,
    inject CSS, identify logged-in users.
  </Card>

  <Card title="Tracking events" icon="chart-mixed" href="/docs/developers/tracking-events">
    The widget emits analytics events (chat opened, lead submitted, and
    more) to GTM, GA4, or your own code.
  </Card>

  <Card title="Webhooks" icon="webhook" href="/docs/developers/webhooks">
    SiteGPT POSTs messages, leads, and escalations to your endpoint as they
    happen.
  </Card>

  <Card title="Agent API (v2)" icon="cloud" href="/docs/api-reference/v2/getting-started">
    A full REST API over chatbots, knowledge, conversations, leads, and
    settings. OpenAPI spec included.
  </Card>

  <Card title="CLI" icon="terminal" href="/docs/cli/overview">
    Create and manage chatbots from the command line, or let coding agents
    do it. Includes an onboarding flow that goes from URL to working chatbot
    in one command.
  </Card>

  <Card title="MCP server" icon="robot" href="/docs/cli/mcp-server">
    Connect AI agents (Claude, Cursor, and others) to your SiteGPT account
    through the Model Context Protocol.
  </Card>
</CardGroup>

## Credentials: the Agents page

Programmatic access is authenticated with API tokens, managed on the
**Agents** page in the top navigation. Tokens are scoped: you choose which
permissions they carry and which chatbots they can touch. The same page
manages MCP connections.

See [API tokens & MCP](/docs/developers/api-tokens-and-mcp) for the full model,
and note that the legacy v0 API uses a separate account API key; the
[v0 reference](/docs/api-reference/getting-started) covers it.

## The five-minute tour

The fastest way to feel the surface, assuming the widget is already
[installed](/docs/setup/integrating-with-your-website):

1. Open your site with the widget and run
   `$sitegpt.push(['open'])` in the browser console. The chat opens; the
   [SDK](/docs/developers/sdk) is live on your page.
2. Add a listener: `$sitegpt.push(['on', 'conversation_started', console.log])`
   and start a chat. That is [tracking events](/docs/developers/tracking-events).
3. Point a [webhook](/docs/developers/webhooks) lane at a request inspector and
   send a message; the `ADD_MESSAGE` payload arrives.
4. Create a token on **Agents** and call
   `curl -H "Authorization: Bearer sgpt_..." https://sitegpt.ai/api/v2/me`.
   That is the [Agent API](/docs/api-reference/v2/getting-started).
