Skip to main content
CoreSDK
Reference

Configuration Reference

All CoreSDK configuration options.

Configuration Reference

Config file

coresdk.toml is the primary configuration file, read at sidecar startup.

coresdk.toml
[sdk]
sidecar_addr  = "[::1]:50051"
tenant_id     = "acme-corp"
service_name  = "my-api"
fail_mode     = "open"
dev_mode      = false

[observability]
service_version = "0.1.0"
otel_endpoint   = ""

Environment variables

Environment variables override coresdk.toml values. See the Environment Variables reference for the full list.

VariableDescription
CORESDK_SIDECAR_ADDRgRPC address of the sidecar daemon (e.g. [::1]:50051)
CORESDK_TENANT_IDTenant ID for this service instance
CORESDK_SERVICE_NAMEValue of the service.name OTel resource attribute
CORESDK_FAIL_MODEopen (default) or closed
CORESDK_JWKS_URLHTTPS URL of the JWKS endpoint
CORESDK_POLICY_DIRDirectory of .rego policy files
CORESDK_LOG_LEVELtrace | debug | info | warn | error
OTEL_EXPORTER_OTLP_ENDPOINTOTLP gRPC endpoint for traces and metrics

SDK initialisation

Python

from coresdk import CoreSDKClient, SDKConfig

# Explicit config
sdk = CoreSDKClient(SDKConfig(
    sidecar_addr="[::1]:50051",
    tenant_id="acme-corp",
    service_name="my-api",
    fail_mode="open",
))

# From environment variables (CORESDK_*)
sdk = CoreSDKClient(SDKConfig.from_env())

Rust

use coresdk_engine::{Engine, EngineConfig};

let engine = Engine::from_env()?;

Middleware

Python — FastAPI

from coresdk.middleware.fastapi import CoreSDKMiddleware

app.add_middleware(CoreSDKMiddleware, sdk=sdk)

Python — Flask

from coresdk.middleware.flask import CoreSDKFlask

CoreSDKFlask(app, sdk=sdk)

Go, TypeScript, Java SDKs

Go, TypeScript, and Java SDKs ship in Phase 2. Configuration for those languages will be documented when the SDKs are available.

On this page