Environments and API keys
Understand how Sankofa resolves live versus test traffic and what the engine expects on each ingest request.
server/engine/cmd/sankofa/main.goSankofa projects support two traffic modes:
livetest
The engine determines which environment to write to by inspecting the API key on every request.
How environment resolution works
For the core v1 ingest routes, the engine checks:
api_keytest_api_key
If the provided x-api-key header matches the project live key, the event is
stored as live. If it matches the test key, the event is stored as test.
Required authentication header
Every direct ingest request must include:
x-api-key: sk_live_12345
If the header is missing, the engine returns 401. If the key is unknown, it
returns 403.
Practical workflow
Use the test key while you are:
- validating SDK initialization
- verifying event names and property maps
- testing replay or onboarding flows
Use the live key when you are ready for production traffic.
Environment is not a query parameter
The core ingest routes do not accept an explicit environment field. The
environment is inferred from the API key that resolves to the project.
Related routes
The same key-resolution pattern is used by:
POST /api/v1/trackPOST /api/v1/peoplePOST /api/v1/aliasGET /api/ee/replay/configin enterprise buildsPOST /api/ee/replay/chunkin enterprise builds