Skip to Content
SDKsJavaScript / TypeScriptInstallation & Setup

Installation & Setup

Install

npm install @useyona/einvoice-js

Package: @useyona/einvoice-js Node.js: 18.0.0 or higher required Dependencies: Zero (uses native fetch, crypto, AbortController) Builds: ESM and CommonJS (dual build)

Initialize

import { EInvoice } from '@useyona/einvoice-js'; const client = new EInvoice({ apiKey: 'sk_test_your_key_here' });

The SDK auto-detects your environment from the key prefix:

  • sk_test_* — Sandbox (invoices not submitted to tax authority)
  • sk_live_* — Production (real submissions, irreversible)

With organization ID

Some services (webhooks, API keys, users) require an organization ID:

const client = new EInvoice({ apiKey: 'sk_test_your_key_here', organizationId: '9f8e7d6c-5b4a-3210-fedc-ba9876543210', });

Calling an org-scoped method without organizationId throws EInvoiceConfigError.

CommonJS

const { EInvoice } = require('@useyona/einvoice-js'); const client = new EInvoice({ apiKey: 'sk_test_your_key_here' });

Next: Configuration →

Last updated on