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

# Bunny Edge Scripting

> Connect your Edge Scripts to Bunny Database using environment variables

You can connect [Edge Scripts](/docs/scripting) to your database by adding credentials as environment variables directly from the database dashboard.

**1. Go to the Access page**

Navigate to **Dashboard > Edge Platform > Database > \[Select Database] > Access**.

**2. Generate tokens**

Click **Generate Tokens** to create new access credentials for your database.

![Generate Tokens](https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/database/connect/generate-tokens.png?fit=max\&auto=format\&n=GYo51EPI6zuebYhU\&q=85\&s=0f93492b4c9e0c7a9a688aa6e61f423b)

**3. Add to script**

Once the tokens are generated, click **Add Secrets to Edge Script**.

![Add to
Script](https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/database/connect/scripting/add-secrets-to-edge-script.png?fit=max\&auto=format\&n=GYo51EPI6zuebYhU\&q=85\&s=96f495060cdccd3df9e743ea47a1a363)

**4. Select your script**

Choose the Edge Script you want to connect to your database.

![Select Script](https://mintcdn.com/bunnynet-cb9733c2/GYo51EPI6zuebYhU/images/database/connect/scripting/select-edge-script.png?fit=max\&auto=format\&n=GYo51EPI6zuebYhU\&q=85\&s=4f39aa5ccf52489951710fcfa041fa68)

**5. Access the environment variables**

The database URL and access token are now available as environment variables in your script. Use them to connect to your database:

```typescript theme={null}
import { createClient } from "@libsql/client/web";
import process from "node:process";

const client = createClient({
  url: process.env.BUNNY_DATABASE_URL,
  authToken: process.env.BUNNY_DATABASE_AUTH_TOKEN,
});

const result = await client.execute("SELECT * FROM users");
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.