Skip to content

Autoload .env for example configuration - #3

Merged
ifsantana merged 1 commit into
mainfrom
feat/autoload-dotenv-for-examples
Jul 21, 2026
Merged

Autoload .env for example configuration#3
ifsantana merged 1 commit into
mainfrom
feat/autoload-dotenv-for-examples

Conversation

@ifsantana

@ifsantana ifsantana commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Every example crashed with IDEM_BASE_URL is not set unless IDEM_BASE_URL/IDEM_API_KEY were exported into the real shell environment — System.getenv() never read the .env file the README instructs you to create.
  • Added io.github.cdimascio:dotenv-kotlin and a shared requiredEnv() helper (support/Env.kt) used by all 5 examples; a real host env var still takes precedence over .env.
  • Documented .env setup (what each variable should be, where the values come from) in the README.

Test plan

  • ./mvnw compile succeeds with the new dependency
  • Ran StablecoinOnChainExampleKt with only .env populated (no shell exports) — it now reaches the client instead of failing on IDEM_BASE_URL is not set (failed later only on a stale API key value already in the local .env, unrelated to this change)

Each example crashed with "IDEM_BASE_URL is not set" unless the vars
were exported into the real shell environment first, because
System.getenv() never looked at the .env file the README tells you to
create. Add dotenv-kotlin and a shared requiredEnv() helper (host env
still wins over .env), and document .env setup in the README.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ifsantana
ifsantana merged commit af7798a into main Jul 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant