Environment variables
Required
| Variable | Description |
|---|---|
AMLEXIA_SDK_KEY | Project SDK key from the dashboard (am_...). Server-side only. |
Recommended
| Variable | Default | Description |
|---|---|---|
AMLEXIA_INGEST_URL | https://ingest.amlexia.com | Ingest API base URL |
AMLEXIA_ENVIRONMENT | — | Label on events: production, staging, etc. |
AMLEXIA_RELEASE | — | Deploy version or git SHA |
AMLEXIA_SERVICE_NAME | api (Django) | Service name on HTTP events |
Node.js
NODE_ENV is used as default environment on trace context when not set on the event.
typescript
const client = new AmlexiaClient({
sdkKey: process.env.AMLEXIA_SDK_KEY!,
ingestUrl: process.env.AMLEXIA_INGEST_URL,
});Python
python
from amlexia import AmlexiaClient
client = AmlexiaClient.from_env()Reads AMLEXIA_SDK_KEY, AMLEXIA_INGEST_URL, AMLEXIA_ENVIRONMENT, AMLEXIA_RELEASE.
Local development
Point ingest at your local worker when running the full platform:
env
AMLEXIA_INGEST_URL=http://localhost:8787HTTP headers (middleware)
| Header | Purpose |
|---|---|
x-session-id | Attach end-user session to traces |
x-user-id | Attach user id to traces |
Security
- Add placeholders to
.env.example, never real keys. - Do not use
NEXT_PUBLIC_or browser env for the SDK key. - Rotate keys from the dashboard if leaked.
