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 NameDescriptionValue / Example
FATHOM_SDK_AUTHORIZATIONSecurity token used for authenticating API requests.Bearer <redacted>
FATHOM_SDK_BASE_URLThe 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_IDThe unique id of the organization.2cbfe270-d195-48ad-aed1-24145924635c
FATHOM_SDK_PROJECT_IDThe unique id of the current project.20effa8442ea1a309c35e6d9

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(())
}