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

@darkdeploy/node-sdk

v1.2.0

Published

Official Node.js SDK for DarkDeploy feature flags, experiments, and AI configs with real-time SSE streaming

Readme

@darkdeploy/node-sdk

The official Node.js SDK for DarkDeploy — Enterprise Feature Flagging, Live A/B Experimentation, and Dynamic AI Prompt Configurations with Real-Time Server-Sent Events (SSE) Streaming.

npm version License: MIT


Features

  • ⚡ Zero-Latency In-Memory Evaluation: Evaluates flags and experiments locally in microseconds using @darkdeploy/core.
  • 🔄 Real-Time Push Updates via SSE: Flag toggles, rollout changes, and prompt edits stream instantly without polling.
  • 🛡️ Fault-Tolerant & Offline-First: Automatic reconnects with exponential backoff & jitter. Graceful fallbacks ensure your app never crashes.
  • 🧪 Full A/B Experimentation: Automatic exposure logging and conversion metric tracking (client.track).
  • 🤖 Dynamic AI Hyperparameters & Prompts: Update LLM foundation models, temperature, token limits, and system prompts on the fly without redeployment.

Installation

npm install @darkdeploy/node-sdk

Quickstart

import { DarkDeployClient } from "@darkdeploy/node-sdk";

const client = new DarkDeployClient({
  apiKey: "dd_dev_d934289e58292e134bcde54fbf153aa7",
  baseUrl: "https://darkdeploy-api.onrender.com", // Or your local server: http://localhost:4000
});

await client.initialize();
console.log("Connected to DarkDeploy Engine via SSE");

Usage Guide

1. Feature Flag Evaluation

Evaluate whether a feature is active for a specific user based on percentage rollouts or custom targeting rules:

const isEnabled = client.isEnabled("new-checkout-flow", {
  id: "usr_9812",
  attributes: {
    plan: "enterprise",
    country: "US",
  },
});

if (isEnabled) {
  // Render new 1-click checkout experience
}

Detailed evaluation with explanation:

const result = client.evaluate("new-checkout-flow", { id: "usr_9812" });
console.log(result.value);  // true or false
console.log(result.reason); // "RULE_MATCH" | "ROLLOUT" | "DEFAULT" | "OFF"

2. A/B Testing & Variant Tracking

Assign users to experiment variants and track conversion goals:

const experimentKey = "checkout-button-experiment";

// Automatically records an EXPOSURE event to the DarkDeploy telemetry pipeline
const variant = client.getVariant(experimentKey, { id: "usr_9812" });
console.log(`Variant assigned: ${variant?.key} (${variant?.name})`);

// When customer completes purchase, record the CONVERSION metric
await client.track(
  experimentKey,
  { id: "usr_9812" },
  "CONVERSION",
  49.99 // Optional revenue value
);

3. AI Configs & Dynamic LLM Prompts

Dynamically retrieve and hot-swap LLM models, hyperparameters, and prompts at runtime:

const aiConfig = client.getAIConfig(
  "customer-support-agent",
  { id: "usr_9812", attributes: { plan: "enterprise" } },
  {
    model: "gpt-4o",
    temperature: 0.7,
    maxTokens: 1024,
    systemPrompt: "You are a professional enterprise support agent.",
  }
);

console.log("Model:", aiConfig.model); // e.g. "claude-3-5-sonnet"
console.log("Temperature:", aiConfig.temperature); // e.g. 0.2
console.log("Prompt:", aiConfig.systemPrompt);

API Reference

| Method | Parameters | Return Type | Description | | :--- | :--- | :--- | :--- | | initialize() | None | Promise<void> | Fetches snapshots from API and establishes SSE stream. | | isEnabled() | flagKey, context, defaultValue? | boolean | Quick boolean flag evaluation. | | evaluate() | flagKey, context, defaultValue? | EvaluationResult | Full evaluation result including reason and matched rule. | | getVariant() | experimentKey, context | Variant \| null | Assigns variant and fires background EXPOSURE event. | | track() | experimentKey, context, type?, value? | Promise<void> | Records exposure or conversion telemetry event. | | getAIConfig() | flagKey, context, fallback? | AIConfig \| null | Evaluates dynamic LLM model configuration and system prompt. | | close() | None | void | Closes SSE connection and flushes local cache. |


Keywords

darkdeploy, feature flags, feature toggles, launchdarkly alternative, split testing, ab testing, experimentation, server sent events, sse streaming, dynamic prompts, llm config, ai flags, hot reload prompts, node sdk, typescript.

License

MIT