---
title: "Resources"
description: "Provision managed resources like a database branch per run and map their connection details into your app's environment."
---

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

# Resources

The **`resources`** block wires managed resources — like an isolated database
branch — into each run's sandbox. It's the repo-side half of the
[Neon](/integrations/neon) and [Supabase](/integrations/supabase) integrations:
the integration connects the provider at the workspace level, and `resources`
declares that *this repository* wants a branch and how to expose it.

## How it works

Each entry under `resources` is keyed by the integration id and has an **`env`**
map that translates the variable Trevize provides into the variable **your app**
expects:

```json
{
  "resources": {
"neon": {
  "env": {
    "DATABASE_URL": "NEON_DATABASE_URL"
  }
}
  }
}
```

Read the mapping as `"<your app's variable>": "<the variable Trevize provides>"`.
Above, your app's `DATABASE_URL` is set from the `NEON_DATABASE_URL` that Trevize
injects for the run's branch.

> **Declaration is the trigger**
>
> A connected integration does nothing until a repository declares it here.
> Adding the `resources` entry is what makes Trevize provision a branch for the
> run.

## Provided variables

For each declared resource, Trevize provisions a fresh branch per run and injects
these variables into the sandbox (map whichever ones your app needs):

| Resource   | Injected variables                                                   |
| ---------- | -------------------------------------------------------------------- |
| `neon`     | `NEON_DATABASE_URL`, `NEON_BRANCH_ID`                                 |
| `supabase` | `SUPABASE_DATABASE_URL`, `SUPABASE_BRANCH_ID`, `SUPABASE_BRANCH_REF`  |

You can also compose these variables in a [preview](/configuration/preview)
process's `env` — for example `"${NEON_DATABASE_URL}?connection_limit=5"`.

## Mapping more than one variable

Map as many app variables to a provided variable as you need:

```json
{
  "resources": {
"neon": {
  "env": {
    "DATABASE_URL": "NEON_DATABASE_URL",
    "DIRECT_URL": "NEON_DATABASE_URL"
  }
}
  }
}
```

> **Let an agent set it up**
>
> The Neon and Supabase integration pages can copy a setup prompt that detects
> your app's real database variable and writes the correct `resources` block for
> you.

Source: https://docs.trevize.dev/configuration/resources/index.mdx
