Skip to content

feat(security-kit): work with every library (0.2.0) - #2

Merged
BackStacked merged 1 commit into
mainfrom
claude/security-kit-hdle6s
Oct 15, 2026
Merged

BackStacked merged 1 commit into
mainfrom
claude/security-kit-hdle6s

Conversation

@BackStacked

Copy link
Copy Markdown
Contributor

Requested by Himanshu · project thread

What and why

Before: the collector gave you headers to add by hand, and the server helpers had to be wired into each framework yourself.

After: the kit drops into any client or server without forcing a library.

  • Collector: subscribe / getSnapshot, so any reactive library can follow the signals (React, Vue, Svelte, Solid, Angular, RxJS).
  • /browser adapters: signalFetch (any library that takes a custom fetch: our client, graphql-request, urql, Apollo HttpLink, TanStack Query functions), axiosSignals, kySignals, apolloSignals, mergeSignalHeaders, signalStore (Svelte store contract).
  • /react: useDeviceSignals(collector), the one optional peer (react >= 18), built with a "use client" banner.
  • /server adapters: fastifySecurity (plugin, request.security), expressSecurity (middleware, req.security), fetchSecurity (Hono, Next.js, Bun, Deno, Yoga), requestSecurity (any framework or a GraphQL context). Each sets the security headers, optional CORS with preflight, and reads the IP and validated signals.

How: no adapter imports its library; each matches the library's hook shape. The README has a table of how to plug into each library. npm test (44 checks) runs the Express and Fastify adapters on real apps and renders the React hook.

Type

  • Feature
  • Docs

Checklist

  • On a branch (not main)
  • npm run typecheck passes (shared, browser and react compile without Node.js types)
  • npm test (44), npm run build and scripts/check-dist.mjs pass
  • Docs: README, AGENTS.md, llms.txt, llms-full.txt
  • No real patient data, contact details or signatures

🤖 Generated with Claude Code

https://claude.ai/code/session_01L5Py9guKQFcFPmdme7bRjo


Generated by Claude Code

Collector subscribe/getSnapshot; browser adapters for fetch, axios, ky,
Apollo and stores; optional React hook; server adapters for Express,
Fastify and Fetch-standard servers. No adapter imports its library.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5Py9guKQFcFPmdme7bRjo
@BackStacked BackStacked self-assigned this Oct 15, 2026
@BackStacked
BackStacked merged commit aee153f into main Oct 15, 2026
1 check passed
@BackStacked
BackStacked deleted the claude/security-kit-hdle6s branch October 15, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants