FAILPATH_PROJECT_KEY — to authenticate your SDK and CLI. Where and how you set that variable depends on which environment your code is running in. This page covers local development, deployed backends, and test environments.
Development
When you runnpx failpath init, the CLI writes your project key to a .env file in your repository root and adds .env to your .gitignore automatically. In local development, this file is all you need — both the CLI commands (publish, sync) and the SDK will read from it.
The
init command updates your .gitignore to exclude .env automatically. If you use a different env file convention (for example .env.local), make sure your project key file is listed in .gitignore before committing.Production and deployed backends
A repository.env file is not available in most deployed environments. You must set FAILPATH_PROJECT_KEY directly in your runtime environment using your platform’s secret or environment variable management.
Disabling in tests
Setenabled: false to prevent the SDK from sending any telemetry during your test suite. When disabled, step() still executes the wrapped function and returns its result normally — only the network calls are skipped.
?? "test" fallback ensures the SDK does not throw when FAILPATH_PROJECT_KEY is not set in your test environment.
If your tests need to assert which events are emitted, use the mock client instead:
Local API development
If you are developing against a local instance of the Failpath API itself, you can override the default endpoint (https://api.failpath.dev) by setting FAILPATH_DEV_ENDPOINT in your shell, or by passing --endpoint to any CLI command:
FAILPATH_DEV_ENDPOINT in production deployments.