Skip to content

Configuration

Nene2ClientConfig

FieldTypeDescription
baseUrlstringAPI origin, no trailing slash (normalized)
apiKeystring?Sent as X-NENE2-API-Key
bearerstring?Authorization: Bearer …
fetchtypeof fetch?Test double or polyfill
signalAbortSignal?Forwarded to every request
timeoutMsnumber?Per-request timeout (AbortSignal.timeout)

Environment variables (apps)

VariablePurpose
NENE2_JS_API_BASE_URLLive smoke / local dev
NENE2_JS_OPENAPI_PATHOverride for contracts:sync
NENE2_MACHINE_API_KEYMachine routes (from NENE2 docs)
NENE2_LOCAL_JWT_SECRETDev JWT issuance on server

The SDK forwards credentials; it does not read .env files. Never commit secrets.

Security notes

  • Treat baseUrl as trusted configuration (SSRF risk if end-users control it).
  • Log Nene2ClientError carefully — problem.detail may contain server messages.
  • Path IDs are interpolated with String(id); prefer numeric IDs or sanitized strings from your domain layer.

Released under the MIT License.