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

# Environment Variables

Environment Variables are persistent variables that are available across your entire workspace. Typically, these are used to store things like external API keys or other sensitive information that you need to use across multiple function stacks, without storing it in a database table.

<Frame>
  <iframe src="https://demo.arcade.software/tKoCMy9H9eGLCgrNGSUc?embed" title="https://demo.arcade.software/tKoCMy9H9eGLCgrNGSUc?embed" allowFullScreen allow="clipboard-write" class="contentkit-webframe" width="1000" height="500" />
</Frame>

## Adding Environment Variables

<Steps>
  <Step title="Click the gear icon in the upper-right corner to open Settings" />

  <Step title="On the next screen, click 'Manage' to edit your environment variables">
    <Frame>
      <img src="https://mintcdn.com/xano-997cb9ee/rOuOq7qlTNyaIMAW/images/574d317b-image.jpeg?fit=max&auto=format&n=rOuOq7qlTNyaIMAW&q=85&s=f13ec2b91d3182c1bbb357cec5836c95" width="86" height="45" data-path="images/574d317b-image.jpeg" />
    </Frame>
  </Step>

  <Step title="Click '+ Variable' to add a new environment variable.">
    <Frame>
      <img src="https://mintcdn.com/xano-997cb9ee/_oKnuVg5Nf4VhJM4/images/473424a8-image.jpeg?fit=max&auto=format&n=_oKnuVg5Nf4VhJM4&q=85&s=e90dae224847b5221330e3188469b6c6" width="105" height="47" data-path="images/473424a8-image.jpeg" />
    </Frame>

    Give your environment variable a name that you can easily recognize; this is how you'll identify it when calling it in function stacks.

    Provide a value for the variable.

    <Info>
      Environment variables can only be updated from your workspace settings.
    </Info>
  </Step>

  <Step title="Use environment variables in your function stacks">
    They'll be available in the dropdown under **ENV**

    <Frame>
      <img src="https://mintcdn.com/xano-997cb9ee/pz6e9Ndbn8i3u8Zz/images/638f6ada-image.jpeg?fit=max&auto=format&n=pz6e9Ndbn8i3u8Zz&q=85&s=2fec1269c6dcbeed7d97f78242724f01" width="596" height="272" data-path="images/638f6ada-image.jpeg" />
    </Frame>
  </Step>
</Steps>

## Xano-generated Environment Variables

Xano maintains several environment variables you can use.

| Variable Name          | Contents                                                |
| ---------------------- | ------------------------------------------------------- |
| \$remote\_ip           | Contains the IP address the request came from           |
| \$http\_headers        | Contains the headers of the request                     |
| \$request\_uri         | Contains the URL of the request                         |
| \$request\_querystring | Contains any URL parameters attached to the request URL |
| \$datasource           | Contains the datasource the request is targeting        |
| \$branch               | Contains the branch the request is targeting            |
| \$request\_method      | Contains the request method (GET, POST, DELETE, etc...) |
