Skip to main content

What are 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. Environment variables can be read in any logic or workflow, but they can not be modified from anywhere but this settings panel, so it’s best to only use them for things that you don’t need to change often.

Adding Environment Variables

From the left-hand navigation, click Settings. On the next screen, click ‘Manage’ to edit your environment variables.
environment-variables-20251013-085352
Click ’+ Add Variable’ at the bottom of the panel that opens to add a new 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. Then, supply the value.
environment-variables-20251013-085442

Using Environment Variables

Environment variables are available in any logic or workflow from a value dropdown under ENV.
environment-variables-20251013-085918

Xano-generated Environment Variables

Xano maintains several environment variables you can use.
VariableDescription
$remote_ipResolves to the IP address of the individual accessing the API endpoint.
$http_headersA text array of headers that are sent to the API endpoint.
$api_baseurlContains the base URL of the active endpoint.
$request_uriContains the URI being accessed from the API.
$request_methodThe HTTP method (GET, POST, DELETE, etc.) of the incoming API request.
$request_querystringContains the query string of the URI being accessed from the API.
$request_auth_tokenContains the authorization token of the API request.
$datasourceIndicates which datasource is being used.
$branchIndicates which branch is being used.
I