Decks client, and the SDK attaches it as a Bearer token on every subsequent call.
Obtaining an API key
API keys are issued per Ablo workspace. To get yours:- Sign in at tryablo.com and open your workspace.
- Go to Settings → API.
- Copy the key shown on that page.
Passing your API key
TheDecks constructor accepts your key in three equivalent forms. Choose whichever fits your project’s configuration style.
ABLO_API_KEY from the environment.
Using the environment variable
SettingABLO_API_KEY in your environment means you can construct the client with no arguments at all and the SDK will pick up the key automatically:
.env file:
dotenv:
What happens when the key is missing
If theDecks constructor cannot find an API key — neither in the argument nor in ABLO_API_KEY — it throws synchronously before any network call is made:
Security best practices
Follow these guidelines to keep your API keys safe in any environment:- Use environment variables rather than hardcoding keys in source files. The
ABLO_API_KEYconvention is supported natively by the SDK. - Restrict key exposure to server-side code only. Never bundle an API key into a client-side JavaScript bundle or a mobile app binary.
- Rotate keys regularly — especially after personnel changes or if a key may have been exposed. Generate a new key from Settings → API and update your secrets store.
- Audit access periodically. If your Ablo workspace supports multiple keys, remove any that are no longer in use.
Your API key is the only credential the SDK requires. There are no OAuth flows, no token refresh cycles, and no session cookies — just the Bearer key on every request.
Custom base URL (advanced)
In rare cases — such as pointing at a private Ablo deployment or a local development proxy — you can override the default base URL (https://api.abloatai.com) via the options object:
baseURL unset for all standard Ablo workspace usage.