@shelbyb/daywalker-sdk 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +33 -0
  2. package/dist/cli.js +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  # @shelbyb/daywalker-sdk
6
6
 
7
+ [![npm](https://img.shields.io/npm/v/@shelbyb/daywalker-sdk)](https://www.npmjs.com/package/@shelbyb/daywalker-sdk)
8
+ [![CI](https://github.com/Shelbyb/daywalker-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/Shelbyb/daywalker-sdk/actions/workflows/ci.yml)
9
+ [![license](https://img.shields.io/npm/l/@shelbyb/daywalker-sdk)](./LICENSE)
10
+
7
11
  Runtime-agnostic client library for [Daywalker Auth](https://auth.daywalker.dev). Supports **RFC 9421 (HTTP Message Signatures)**, **RFC 9530 (Digest Fields)**, **Web Crypto standards**, **Push Architecture key registration**, and **hardened web & Next.js middleware**.
8
12
 
9
13
  Runs on **Node.js 20.19+**, **Bun**, **Deno**, **Cloudflare Workers**, **Next.js Edge**, and browsers. ESM only; `require()` works on Node 20.19+ and 22.12+.
@@ -177,6 +181,23 @@ app.get("/api/me", (c) => {
177
181
 
178
182
  ---
179
183
 
184
+ ## Express / Connect / Node `http` (`@shelbyb/daywalker-sdk/express`)
185
+
186
+ ```ts
187
+ import express from "express";
188
+ import { daywalkerAuth, daywalkerKeys } from "@shelbyb/daywalker-sdk/express";
189
+
190
+ const app = express();
191
+ app.use(daywalkerKeys()); // serves GET /.well-known/daywalker-keys.json
192
+ app.use("/api", daywalkerAuth({ serviceSlug: "sonalyze" }));
193
+
194
+ app.get("/api/me", (req, res) => res.json({ auth: req.auth }));
195
+ ```
196
+
197
+ `daywalkerAuth` reads `Authorization: Bearer <token>` or `x-api-token`, answers `401` when neither is present, and otherwise returns the same status codes as the other middleware (`429` with `Retry-After`, `503` when Daywalker is unreachable). On success the validated payload is on `req.auth`. Both functions also work with plain `http.createServer` handlers.
198
+
199
+ ---
200
+
180
201
  ## Zero-Egress Offline Verification
181
202
 
182
203
  When high-throughput internal microservices need zero latency and zero external egress, Daywalker Auth can issue asymmetric JWT leases. Configure `DAYWALKER_PUBLIC_KEY` (PEM or standard JWK) and token validation runs entirely in memory without network calls:
@@ -257,6 +278,18 @@ const analytics = createAnalytics({ writeKey: "dpa_…", host: "https://devpulse
257
278
 
258
279
  ---
259
280
 
281
+ ## Provenance & Releases
282
+
283
+ Releases are published from GitHub Actions ([`publish.yml`](./.github/workflows/publish.yml)) with [npm trusted publishing](https://docs.npmjs.com/trusted-publishers): npm accepts a short-lived OIDC token from this repository's workflow, so there is no long-lived npm token anywhere. Each version carries a signed [provenance attestation](https://docs.npmjs.com/generating-provenance-statements) linking it to the commit and workflow run that built it. Check it on the npm page, or after installing:
284
+
285
+ ```bash
286
+ npm audit signatures
287
+ ```
288
+
289
+ To cut a release (maintainers): bump `version` in `package.json`, add a `CHANGELOG.md` entry, merge to `main`, then either push a matching tag (`git tag v0.5.0 && git push origin v0.5.0`) or run the **Publish** workflow from `main` with the version. The workflow refuses tags not on `main`, versions that don't match `package.json`, and versions already on npm. Tests and packing run in a job without the OIDC token; only the final job, which uploads the tested tarball, can publish.
290
+
291
+ ---
292
+
260
293
  ## License
261
294
 
262
295
  MIT
package/dist/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shelbyb/daywalker-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Daywalker Auth service validation plus the DevPulse client SDKs (feature flags, OpenFeature, product analytics) in one zero-dependency package.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",