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

# Quickstart

> From zero to a working backend call in four steps.

Result Backend is your app's hosted backend: Postgres, user auth, file
storage, serverless functions, realtime channels, AI models, transactional
email, and Stripe/Razorpay payments. It is already provisioned - nothing to
install or host.

Your app's page in the Result dashboard has three credentials. Put them in
`.env.local`:

```bash theme={"dark"}
NEXT_PUBLIC_BACKEND_URL=...        # the backend's base URL
NEXT_PUBLIC_BACKEND_ANON_KEY=...   # publishable client key (safe in browsers)
BACKEND_ADMIN_KEY=...              # admin key - server/terminal ONLY
```

## Four steps

1. Persist the backend rules into your repo (writes `AGENTS.md`/`CLAUDE.md`
   so every future AI coding session knows how this backend works):

   ```bash theme={"dark"}
   npx @resultdev/cli init
   ```

2. Install the SDK:

   ```bash theme={"dark"}
   npm install @resultdev/sdk
   ```

3. Create the client:

   ```ts theme={"dark"}
   // lib/backend.ts
   import { createClient } from "@resultdev/sdk";

   export const backend = createClient({
     baseUrl: process.env.NEXT_PUBLIC_BACKEND_URL!,
     anonKey: process.env.NEXT_PUBLIC_BACKEND_ANON_KEY!,
   });
   ```

4. Make a call:

   ```ts theme={"dark"}
   const { data, error } = await backend.database.from("todos").select();
   ```

## The one rule

* **App code** → SDK with the publishable key. Covered in the SDK section.
* **One-time setup** (tables, migrations, buckets, channels, functions,
  secrets, payment keys) → CLI with the admin key, from the terminal.
  Covered in the CLI section.

Never hand-roll HTTP against the backend, and never let `BACKEND_ADMIN_KEY`
reach the browser.

Next: [create your first table](/cli/reference#db-create-table), then read
[Database](/sdk/database).
