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

# Supabase

> Connect Supabase to query your database and analyze your data with natural language

Connect Adapt to Supabase to query your database and analyze your data using
natural language. Adapt reads from your Supabase project through its API, so you
can explore tables and pull insights without writing SQL by hand.

## Set up credentials

Gather these three values from your Supabase project before connecting:

<Steps>
  <Step title="Open your Supabase project">
    Open your project in the [Supabase Dashboard](https://supabase.com/dashboard).
  </Step>

  <Step title="Copy your Project URL">
    Click **Connect** in the top bar, or go to **Settings > Data API**, and copy
    your **Project URL**. It looks like `https://<project-ref>.supabase.co`.
  </Step>

  <Step title="Copy your API keys">
    Go to **Settings > API Keys** and copy:

    * Your **`anon` (public) key** — respects Row Level Security
    * Your **`service_role` key** — bypasses Row Level Security (optional)
  </Step>
</Steps>

<Note>
  Supabase is rolling out new **publishable** (`sb_publishable_...`) and **secret**
  (`sb_secret_...`) API keys that replace the legacy `anon` and `service_role`
  keys. They are drop-in compatible: use the publishable key for
  `SUPABASE_ANON_KEY` and the secret key for `SUPABASE_SERVICE_ROLE_KEY`. Both are
  available under **Settings > API Keys**.
</Note>

## Connect to Adapt

<Steps>
  <Step title="Open Integrations">
    In Adapt, go to **Settings > Integrations**.
  </Step>

  <Step title="Find Supabase">
    Search for **Supabase** and select it from the catalog.
  </Step>

  <Step title="Start the connection">
    Click **Connect** to open the connection form.
  </Step>

  <Step title="Add your credentials">
    Enter the values you gathered above, then click **Add connection**:

    | Secret Name                 | Value                              |
    | --------------------------- | ---------------------------------- |
    | `SUPABASE_URL`              | Your project URL                   |
    | `SUPABASE_ANON_KEY`         | Your `anon` (public) key           |
    | `SUPABASE_SERVICE_ROLE_KEY` | Your `service_role` key (optional) |

    You can rename the connection and choose whether it is shared with your
    organization or kept personal to you.
  </Step>

  <Step title="Test the connection">
    Ask Adapt to list your tables or query your data.
  </Step>
</Steps>

### Security

* Credentials are encrypted at rest with AES-256
* The `anon` key only exposes data allowed by your Row Level Security policies
* The `service_role` key bypasses Row Level Security and has full access to your
  data, so only add it when Adapt needs to read tables protected by RLS
* Never share these keys publicly or commit them to source control

## Capabilities

Adapt can query your Supabase database. Explore your tables and analyze your
data using natural language.

### Examples

Explore data:

```
What tables are in my Supabase database?
```

Query data:

```
Show me the 10 most recent signups from the users table
```

Analyze trends:

```
How many orders were placed each week over the past month?
```

Generate reports:

```
Summarize the key metrics from my Supabase data
```
