> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-support-migration.mintlify.site/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](/scripting) to your database by adding credentials as environment variables directly from the database dashboard.

<Steps>
  <Step title="Go to the Access page">
    Navigate to **Dashboard > Edge Platform > Database > \[Select Database] > Access**.
  </Step>

  <Step title="Generate tokens">
    Click **Generate Tokens** to create new access credentials for your database.

    <Frame>
      <img src="https://mintcdn.com/bunnynet-cb9733c2-support-migration/Z09ZI7FyatCuoSuT/images/database/connect/generate-tokens.png?fit=max&auto=format&n=Z09ZI7FyatCuoSuT&q=85&s=68d4bdc9c3e1bcbfd0b17665723bfdb5" alt="Generate Tokens" width="770" height="508" data-path="images/database/connect/generate-tokens.png" />
    </Frame>
  </Step>

  <Step title="Add to script">
    Once the tokens are generated, click **Add Secrets to Edge Script**.

    <Frame>
      <img
        src="https://mintcdn.com/bunnynet-cb9733c2-support-migration/Z09ZI7FyatCuoSuT/images/database/connect/scripting/add-secrets-to-edge-script.png?fit=max&auto=format&n=Z09ZI7FyatCuoSuT&q=85&s=545d7b1dbe01357ab34677349370bce4"
        alt="Add to
Script"
        width="898"
        height="876"
        data-path="images/database/connect/scripting/add-secrets-to-edge-script.png"
      />
    </Frame>
  </Step>

  <Step title="Select your script">
    Choose the Edge Script you want to connect to your database.

    <Frame>
      <img src="https://mintcdn.com/bunnynet-cb9733c2-support-migration/Z09ZI7FyatCuoSuT/images/database/connect/scripting/select-edge-script.png?fit=max&auto=format&n=Z09ZI7FyatCuoSuT&q=85&s=ec2022aea7621dcc0320c153c4e59600" alt="Select Script" width="872" height="664" data-path="images/database/connect/scripting/select-edge-script.png" />
    </Frame>
  </Step>

  <Step title="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");
    ```
  </Step>
</Steps>
