Environment variables
Pre-injected environment variables providing automated authentication and project context for all platform Functions and Notebooks.
To streamline development and ensure seamless integration with the platform, every Function and Notebook is automatically injected with a set of predefined environment variables. These variables allow the SDK to authenticate and communicate with the necessary services without manual configuration.
System Variables
| Variable Name | Description | Value / Example |
|---|---|---|
| FATHOM_SDK_AUTHORIZATION | Security token used for authenticating API requests. | Bearer <redacted> |
| FATHOM_SDK_BASE_URL | The primary API endpoint for the platform. | https://internal-address/ |
| FATHOM_SDK_SERVICE_PATH_* | Dynamic paths assigned to specific platform sub-services. | /v1/service-name |
| FATHOM_SDK_ORGANIZATION_ID | The unique id of the organization. | 2cbfe270-d195-48ad-aed1-24145924635c |
| FATHOM_SDK_PROJECT_ID | The unique id of the current project. | 20effa8442ea1a309c35e6d9 |
Important
These variables are injected automatically by the platform runtime. You do not need to define them manually in your deployment configuration.Accessing Variables
You can access these variables within your code using standard environment lookups:
import os
import requests
base_url = os.environ.get("FATHOM_SDK_BASE_URL")
service_path = os.environ.get("FATHOM_SDK_SERVICE_PATH_ML")
url = f"{base_url}{service_path}/openapi"
headers = {
'Authorization': f'Bearer {os.environ.get("FATHOM_SDK_AUTHORIZATION")}'
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
print('Success:', response.json())
else:
print(f'Error: {response.status_code}')use std::env;
use reqwest::header::AUTHORIZATION;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let base_url = env::var("FATHOM_SDK_BASE_URL")?;
let service_path = env::var("FATHOM_SDK_SERVICE_PATH_ML")?;
let auth_token = env::var("FATHOM_SDK_AUTHORIZATION")?;
let url = format!("{base_url}{service_path}/openapi");
let client = reqwest::Client::new();
let response = client
.get(url)
.header(AUTHORIZATION, format!("Bearer {auth_token}"))
.send()
.await?;
println!("Status: {}", response.status());
Ok(())
}