Skip to content

← All questions

Unresolved variable ${API_TOKEN} at "env.api.auth.token" — where is it supposed to look?

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

Added bearer auth to the staging environment file:

yaml
api:
  baseUrl: https://jsonplaceholder.typicode.com
  auth: { type: bearer, token: "${API_TOKEN}" }

Then:

bash
sdods run -p demo-shop -e staging -l api

It dies before a single request goes out:

text
✖ CONFIG_UNRESOLVED_VAR: Unresolved variable ${API_TOKEN} at "env.api.auth.token".
  hint: Add API_TOKEN=... to .env or .env.<env> (repo root or project folder), or export it in the shell.
  docs: https://docs.sdods.com/docs/guides/configuration

The value is in a file next to the project yaml called env.staging. What am I missing?

2 answers

Know the answer?

Wrap commands and output in triple backticks and they will render as a code block.

Checking whether you’re signed in…

Have a different question? Ask it.

Related