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.

Adding Environment Variables

1

From the left-hand navigation, click Settings

2

On the next screen, click to edit your environment variables

3

Click to add a new environment variable.

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.

Environment variables can only be updated from your workspace settings.

4

Use environment variables in your function stacks

They'll be available in the dropdown under ENV

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...)

Last updated

Was this helpful?