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

@decionis/sdk-node

v0.1.0

Published

Node SDK and service-boundary middleware for policy-gated Decionis execution.

Readme

@decionis/sdk-node

Node SDK for the canonical Decionis policy-evaluation route.

Install

npm install @decionis/sdk-node

It includes:

  • a typed client for POST /v1/protocol/evaluate-decision
  • a typed execution-authority client for POST /v1/authority/enforce-and-bind
  • Express middleware for service-boundary policy gating
  • Express verifier middleware for Decionis execution tokens
  • Fastify pre-handler hooks for the same pattern

Core pattern

  1. Build a Decionis decision request from the incoming HTTP request.
  2. Call Decionis before the route mutates state.
  3. Continue on APPROVE, or deny on REJECT, REVIEW, and ESCALATE by default.
  4. Forward Decision Dossier identifiers back through response headers.

Package contents

  • ESM and CommonJS builds in dist/
  • TypeScript declarations
  • middleware helpers that do not require a direct runtime dependency on Express

Release

For repository-backed packaging and publish automation, use the workflow documented in docs/package-distribution.md.

Example

import { createDecionisNodeSdk, createExpressPolicyGate } from "@decionis/sdk-node";

const client = createDecionisNodeSdk({
  baseUrl: process.env.DECIONIS_BASE_URL!,
  apiKey: process.env.DECIONIS_API_KEY!,
  defaultRequest: {
    policy_version: "payments-v1",
    objective_profile: "risk_conservative",
    mode: "ENFORCEMENT",
  },
});

app.post(
  "/payments/release",
  createExpressPolicyGate({
    client,
    buildDecisionRequest: (req) => ({
      org_id: process.env.DECIONIS_ORG_ID!,
      decision_type: "PAYMENT_RELEASE",
      amount: Number(req.body.amount),
      workflow_key: "payment_release",
      vertical_pack: "finance",
      context: {
        route: req.originalUrl,
        actor_id: req.user?.id,
      },
    }),
  }),
  releasePaymentHandler,
);

Execution Authority

SDK code packages action intent and binds execution through Decionis. Policy rules stay in the Authority API, not in the agent process.

import { createDecionisExecutionClient } from "@decionis/sdk-node";

const decionis = createDecionisExecutionClient({
  authorityBaseUrl: process.env.DECIONIS_AUTHORITY_URL!,
});

await decionis.enforceAndExecute({
  request: {
    tenant_id: "tenant_demo",
    actor: { id: "research_agent", type: "AI_AGENT", runtime: "mcp" },
    action: { type: "SEND_PAYMENT", resource: "wallet.usdc", amount: 0.25, currency: "USD" },
    downstream_target: {
      system: "payment_api",
      operation: "send_payment",
      endpoint: "POST /payments",
    },
  },
  execute: ({ executionToken }) =>
    paymentApi.sendPayment({
      amount: 0.25,
      token: executionToken,
    }),
});

Downstream services should verify and consume the token before mutating state:

import { createExpressExecutionTokenVerifier } from "@decionis/sdk-node";

app.post(
  "/payments",
  createExpressExecutionTokenVerifier({
    authorityBaseUrl: process.env.DECIONIS_AUTHORITY_URL!,
    buildVerificationRequest: (req) => ({
      actor_id: req.body.actor_id,
      action_type: "SEND_PAYMENT",
      resource: "wallet.usdc",
      amount: Number(req.body.amount),
      currency: "USD",
      downstream_target: {
        system: "payment_api",
        operation: "send_payment",
        endpoint: "POST /payments",
      },
    }),
  }),
  paymentHandler,
);