Xano Documentation

Environment Variables

These are accessible throughout your Queries, Addons, Functions, and Tasks. Environment Variables are a great place to store private information like API keys in a single location.
Environment Variables are Variables that can be used by multiple APIs or Functions. They are set up on the settings page of your Workspace.
$remote_ip: This is a special environment variable that resolves to the IP address of the individual accessing the API Endpoint.
$http_headers: This is a text Array of headers that are sent to the API Endpoint.
$request_uri: Returns the request URI.
$request_querystring: Returns the query string from the request.
$datasource: Returns the active data source being used for database queries.
https headers: https headers are what is sent to the API. There is no pre-populated list because it depends on what is sent. But you can add the headers to the response to see what is being sent:
In this example, we are returning the Environment variable $http_headers.
In this example, we can see the headers being sent to the API through the response.
We can use dot notation to use or return a specific header:
In this example, we are using dot notation to return the header X-Request-Id
The result, as shown in Swagger, is the value of the X-Request-Id header.
Last modified 6mo ago