Skip to main content
Use this guide when you need to pick the right Lomadee environment, wire credentials into your deployment, and keep partner secrets out of source control.

Choose an environment

The SDK accepts an optional environment field on construction:
The SDK routes each resource client to the correct service hosts for the selected environment. You do not pass base URLs or per-service overrides.
Staging and production may use different authKey values. Confirm which key belongs to which environment with your Lomadee contact—do not assume one key works in both.

Store the authKey as a secret

Your authKey is equivalent to a long-lived API credential. Treat it like a database password:
  1. Load from environment variables (or your platform’s secret manager) at process startup.
  2. Never commit the key to git, .env files checked into the repo, Docker image layers intended for public registries, or client-side bundles.
  3. Restrict access in CI/CD and production to the roles that need it.
  4. Rotate on compromise—contact Lomadee support if a key may have leaked.
Use a factory or dependency-injection container so tests can substitute a mock client without touching real credentials. @thelomadee/sdk is published on the public npm registry. Installing it does not require a GitHub token or a custom .npmrc. Keep authKey as the only runtime secret.

Keep the SDK server-side

The SDK attaches authKey as the x-auth-key header on every outbound request. Any process that loads the SDK therefore holds full partner access.

Local development checklist

  • LOMADEE_AUTH_KEY is set in your shell or local .env (gitignored)
  • Quickstart script runs successfully with sdk.terms.latest()
  • environment: 'staging' is used only when intentionally testing against staging