Deployment
Production Mode
For production, use mode="http" with your API base URL. The SDK POSTs events to {endpoint}/v1/events:
import os
from r3fresh import ALM
alm = ALM(
agent_id="prod-agent",
env="production",
mode="http",
endpoint="https://api.yourcompany.com",
api_key=os.getenv("ALM_API_KEY"),
agent_version="1.0.0",
)Event Batching
Events are batched (default 50) and POSTed to your endpoint. The SDK:
- Buffers events and flushes on batch size or at run end
- Catches flush failures so the agent does not crash
- Sends
Authorization: Bearer <api_key>whenapi_keyis set
Development vs Production
Use mode="stdout" for development to see events as JSON lines. Switch to mode="http" for production to send events to your backend.