Environment Variables
Every configuration option available for LocusGraph SDKs.
Reference
| Variable | Required | Default | Description |
|---|---|---|---|
LOCUSGRAPH_SERVER_URL | No | https://api.locusgraph.com | API server URL |
LOCUSGRAPH_AGENT_SECRET | Yes | — | Agent authentication token |
Setting Environment Variables
Create a .env file in your project root:
# .env file
LOCUSGRAPH_SERVER_URL=https://api.locusgraph.com
LOCUSGRAPH_AGENT_SECRET=your-agent-secretNever commit
LOCUSGRAPH_AGENT_SECRET to version control. Add .env to your .gitignore immediately.Per-Language Usage
TypeScript reads from environment automatically, or accepts explicit config:
const client = new LocusGraphClient({
serverUrl: process.env.LOCUSGRAPH_SERVER_URL,
agentSecret: process.env.LOCUSGRAPH_AGENT_SECRET,
});Python reads from environment automatically, or accepts constructor arguments:
client = LocusGraphClient(
server_url=os.environ.get("LOCUSGRAPH_SERVER_URL"),
agent_secret=os.environ.get("LOCUSGRAPH_AGENT_SECRET"),
)Rust reads from environment automatically, or accepts config:
let client = LocusGraphClient::new(None); // reads from envAll three SDKs follow the same priority: explicit config overrides environment variables, which override defaults. If you pass None or omit a field, the SDK falls back to the environment variable. If that is unset, it uses the default (for LOCUSGRAPH_SERVER_URL) or returns an error (for LOCUSGRAPH_AGENT_SECRET).