npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quantumdmn/sdk

v1.0.0

Published

QuantumDMN TypeScript/JavaScript SDK for the DMN Engine API

Readme

QuantumDMN JavaScript/TypeScript SDK

Official TypeScript/JavaScript SDK for the QuantumDMN DMN Engine API.

Installation

npm install @quantumdmn/sdk
# or
yarn add @quantumdmn/sdk

Features

  • Full TypeScript support with complete type definitions
  • Axios-based HTTP client
  • Automatic token injection for authentication
  • Tree-shakeable - import only what you need

Quick Start

import { createClient, DmnEngine, FeelValue, ZitadelTokenProvider } from '@quantumdmn/sdk';

// 1. Setup Authentication
// For backend services, use ZitadelTokenProvider with a service account key
const tokenProvider = new ZitadelTokenProvider(
    './service-account.json', 
    'https://auth.quantumdmn.com', 
    'your-zitadel-project-id'
);

// 2. Initialize Client
const client = createClient({
    baseUrl: 'https://api.quantumdmn.com',
    tokenProvider: tokenProvider.getProvider(),
});

// 3. Initialize Engine client
const engine = new DmnEngine(client, 'your-project-id');

// 4. Prepare Context
const context = {
    age: FeelValue.ofNumber(25),
    income: FeelValue.ofNumber(50000),
    role: FeelValue.ofString('admin'),
    active: FeelValue.ofBoolean(true)
    // Or let auto-inference handle it:
    // ...FeelValue.from({ other: 123 }).asContext()
};

// 5. Evaluate Decision
try {
    const result = await engine.evaluate('your-definition-id', context);
    console.log('Result:', result);
} catch (error) {
    console.error('Evaluation failed:', error);
}

Authentication

The SDK provides built-in support for Service Account authentication via ZitadelTokenProvider.

Service Account Authentication (Node.js)

  1. Download your Service Account JSON key file.
  2. Install required dependencies:
    npm install jsonwebtoken
  3. Use ZitadelTokenProvider:
import { ZitadelTokenProvider } from '@quantumdmn/sdk';

const auth = new ZitadelTokenProvider(
    '/path/to/key.json',           // Path to JSON key file
    'https://auth.quantumdmn.com', // Auth Server URL
    'your-zitadel-project-id'      // Project ID (numeric) for audience scope
);

// Get a raw token if needed
const token = await auth.getToken();

Manual Token Handling

If you are using a different authentication method or running in the browser with an existing token:

import { createClientWithToken } from '@quantumdmn/sdk';

const client = createClientWithToken('https://api.quantumdmn.com', 'your-access-token');

Type-Safe FEEL Values

The FeelValue class ensures type safety when working with DMN Data Types.

import { FeelValue } from '@quantumdmn/sdk';

// Creation
const num = FeelValue.ofNumber(10);
const str = FeelValue.ofString('hello');
const bool = FeelValue.ofBoolean(true);
const list = FeelValue.ofList([num, str]);
const ctx = FeelValue.ofContext({ field: num });

// Inference
const fromRaw = FeelValue.from({ 
    amount: 1000, 
    currency: 'USD',
    tags: ['sales', 'Q1'] 
});

// Unwrapping
const raw = fromRaw.toRaw(); // { amount: 1000, ... }
const numVal = num.asNumber(); // 10

API Reference

DmnEngine

  • evaluate(xmlDefinitionId: string, context: Record<string, FeelValue>): Evaluate a deployed definition.

Client Helpers

All generated API methods are available via createClient().default.

  • listProjects()
  • createDefinition()
  • evaluateStored()
  • ...and more

License

MIT License - see LICENSE for details.