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

@devfellowship/sdk

v0.4.0

Published

DevFellowship SDK — Supabase-compatible client with workflow primitives, and the DFL client (/client) for the gateway REST front

Readme

@devfellowship/sdk

DevFellowship SDK v0 — Supabase-compatible client with workflow primitives.

Install

npm install @devfellowship/sdk

Usage

import { createDflClient } from "@devfellowship/sdk";

const dfl = createDflClient({
  supabaseUrl: "https://your-project.supabase.co",
  supabaseAnonKey: "your-anon-key",
  natsUrl: "nats://localhost:4222",
  engineUrl: "http://localhost:3335",
});

// Raw Supabase client (same API as @supabase/supabase-js)
const { data } = await dfl.client.from("users").select("*");

// Fire an intent (publishes to NATS DFL_INTENTS stream)
await dfl.wf.fireIntent("onboarding.new_member", {
  intentId: "unique-id-123",
  payload: { userId: "abc", email: "[email protected]" },
});

// Subscribe to workflow instance progress events
const unsub = await dfl.wf.subscribeInstance("instance-uuid", (event) => {
  console.log("Workflow event:", event);
});

// Call engine proxy endpoint
const result = await dfl.wf.proxy("my-service-node", { key: "value" });

LLM proxy

All LLM calls in the DFL fleet should go through dfl-flows-engine so we get unified OTEL spans, cost attribution, and provider-agnostic adoption. wf.chat() is a thin typed wrapper around wf.proxy() for chat-completion workflows.

Quickstart

import { createDflClient, type LlmChatResponse } from "@devfellowship/sdk";

const dfl = createDflClient({
  supabaseUrl: process.env.SUPABASE_URL!,
  supabaseAnonKey: process.env.SUPABASE_ANON_KEY!,
  engineUrl: process.env.DFL_ENGINE_URL!, // required for wf.chat / wf.proxy
});

const res = await dfl.wf.chat(
  "openrouter-chat",
  {
    model: "gpt-4.1-mini",
    messages: [
      { role: "system", content: "You are concise." },
      { role: "user", content: "Title for a 3min video about RLS?" },
    ],
    temperature: 0.4,
  },
  { appName: "lesson-studio" }
);

console.log(res.choices[0].message.content);

The appName is propagated as the X-DFL-App header so the engine can attribute cost back to the right product. If omitted, process.env.DFL_APP_NAME is used as a fallback (Node only — guarded for browser-safe usage).

Available workflow keys

These are the canonical LLM workflow definitions in dfl-flows-definitions (see dfl-flows-definitions#13). Pass any of them as the first arg to wf.chat() / wf.proxy():

| Key | Provider | Shape | |---|---|---| | openrouter-chat | OpenRouter (preferred default per DFL standard) | LlmChatRequest → LlmChatResponse | | openai-chat | OpenAI direct | LlmChatRequest → LlmChatResponse | | groq-chat | Groq | LlmChatRequest → LlmChatResponse | | groq-whisper-transcribe | Groq Whisper | WhisperTranscribeRequest → WhisperTranscribeResponse (use wf.proxy() not wf.chat()) |

Cancellation

Pass an AbortSignal to cancel an in-flight call:

const ctrl = new AbortController();
setTimeout(() => ctrl.abort(), 5_000);

await dfl.wf.chat(
  "openrouter-chat",
  { model: "gpt-4.1-mini", messages: [...] },
  { appName: "dfl-seo", signal: ctrl.signal }
);

Environment variables

When using createDflClientFromEnv():

| Variable | Required | Description | |---|---|---| | SUPABASE_URL | Yes | Supabase project URL | | SUPABASE_ANON_KEY | Yes | Supabase anonymous key | | DFL_NATS_URL | No | NATS server URL for workflow ops | | DFL_ENGINE_URL | No | Flows engine URL — required for wf.proxy() / wf.chat() | | DFL_APP_NAME | No | Default X-DFL-App header value (overridden by opts.appName) |

DFL client — @devfellowship/sdk/client (since 0.3.0)

The browser client of the DFL gateway REST front. It is a supabase-js client: the app keeps the same API. Only the address of the data calls changes. Contract: plan 20261117-fleet-access-s7-rest-front-dfl-client, "REST front contract" C2, C8–C11.

import { createClient } from "@devfellowship/sdk/client";

export const supabase = createClient(
  import.meta.env.VITE_SUPABASE_URL,
  import.meta.env.VITE_SUPABASE_ANON_KEY,
  {
    gatewayUrl: import.meta.env.VITE_DFL_GATEWAY_URL ?? "", // https://gateway.devfellowship.com
    app: "dfl-sheets",
    // every other supabase-js option (auth, db, global, realtime) works as before
  },
);

| Call | Goes to | |---|---| | from(...), rpc(...) (/rest/v1/*) | gatewayUrl + the same path and query | | functions.invoke(...) (/functions/v1/*) | gatewayUrl + the same path | | auth.*, storage.*, realtime | the Supabase URL, unchanged (ADR-2) |

On each call to the front the client adds a W3C traceparent (it keeps a valid one that the caller set) and X-DFL-Client: @devfellowship/sdk@<version>. It adds no other header: the front's CORS list is GATEWAY_CORS_ALLOW_HEADERS.

Options.

| Option | Default | What it does | |---|---|---| | gatewayUrl | required | Base URL of the REST front. "" sends every call to Supabase direct (rollback switch). | | app | required | App slug, sent in each error report. The front reads the app from the Origin. | | fallbackDirectReads | false | On a network error or a 502/503/504 of the front on a GET or HEAD, send the same read once to Supabase direct (RLS holds), with no DFL header, and report it. A write never falls back. | | report | reportToObservability | Gets one DflClientErrorReport per error. |

Errors. A refusal of the front uses the PostgREST error body, so it arrives in error as usual: error.code === "DFL403", error.message, error.hint. For functions.invoke the same JSON is the body of error.context (FunctionsHttpError). The client reports:

  • every answer with a DFL… code (front_error);
  • every other 5xx (upstream_5xx);
  • a network error (network_error) and a direct read (fallback_read).

An upstream PostgREST 4xx (for example PGRST116 of .single()) passes unchanged and is not reported: the app sees and handles it as today. A report holds the trace id (from X-DFL-Trace-Id, else the sent one), the code, the capability, the decision, the route kind (table, rpc, function), the object name, the method and the app. It holds no query string, no body and no token.

The default reporter sends a Sentry error (captureError) and an OTel event (trackEvent, name dfl.client.<kind>) through @devfellowship/observability (optional peer, ^2.2.0; install it in the app, and mount <ObservabilityProvider>, else both calls do nothing). Note: observability 2.2.1 imports @tanstack/react-query at load, so an app without it must add it.

Note: postgrest-js retries a GET on 503 by itself (db.retry, default on).

Trace (since 0.4.0)

Each call to the gateway starts one browser span (dfl.gateway <METHOD> <object>, kind CLIENT) and sends its context as traceparent. The gateway continues it, so the browser span, rest.request and rest.upstream share one trace id in Tempo, on success and on error. The span goes through the tracer that the app registered (<ObservabilityProvider> of @devfellowship/observability), with the sampler of that tracer (always on by default, the same as the gateway). With no tracer the span is a no-op and the client sends a random traceparent, as in 0.3.0. A traceparent that the caller sets is kept and no span starts.