Skip to main content

Requirements

  • Node.js 18 or later, Bun 1 or later, or Deno 1.39 or later. The SDK uses the runtime’s built-in fetch.
  • An API key from the dashboard. Call the API from your server: a key used in a web page is visible to anyone who opens it.

Install

The package has ES module and CommonJS builds and includes its type definitions. Its one dependency is zod, version 3.25 or 4. The package describes itself as beta and warns that a minor release can include breaking changes. Pin an exact version, such as npm install --save-exact @vepler/sdk@6.8.0 (a plain install saves ^6.8.0), and upgrade on purpose.

Set your API key

Keep the key out of your code and read it from the environment:
apiKeyAuth also accepts an async function that returns the key, if you fetch it from a secrets manager.

Check the key

sdk.heritage.types() needs no product licence and is not charged, so it makes a safe first call:
If it throws with statusCode 401, the key is missing or not valid.

TypeScript settings

tsconfig.json
  • lib needs dom and dom.iterable: the SDK’s type definitions use Fetch types such as RequestInfo and HeadersInit, and without them tsc reports errors in those files unless skipLibCheck is on.
  • moduleResolution must be nodenext, node16 or bundler for imports from subpaths such as @vepler/sdk/sdk/models/errors. The older node setting cannot resolve them.
  • With a bundler, "module": "esnext" and "moduleResolution": "bundler" also work.

Troubleshooting