Skip to content

docs: accurate npm READMEs for every package - #73

Merged
cport1 merged 2 commits into
mainfrom
docs/readmes
Nov 10, 2026
Merged

cport1 merged 2 commits into
mainfrom
docs/readmes

Conversation

@cport1

@cport1 cport1 commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

npm pages are where people and AI coding assistants copy install snippets from, so they need to match the code.

Changes

  • New READMEs for @webdecoy/fastify, @webdecoy/nextjs and @webdecoy/hono (their npm pages were blank): install, a minimal working snippet, options with defaults, monitor mode, request/context properties, environment variables actually read, verify step, links to docs.webdecoy.com.
  • @webdecoy/node README rewritten for the current API:
    • apiKey is optional; without it, local rules only (default [tripwire()]) and no network calls.
    • protect() returns a Decision (conclusion, allowed, results with state, deniedBy(), id), not the old { allowed, detection, error } shape.
    • Lists every adapter, not just Express, with @webdecoy/node installed alongside.
    • Keys come from the API Keys page, not "Settings".
    • Monitor mode, createFetchGuard(), clearance on Vercel, and an env-var table: WEBDECOY_API_KEY is not read automatically; only the clearance gate reads WEBDECOY_SITE_KEY / WEBDECOY_SCANNER_ID / WEBDECOY_SENSOR_KEY / WEBDECOY_INGEST, and the captcha checks NODE_ENV.
    • IP enrichment goes through apiUrl (in.webdecoy.com), not api.webdecoy.com.
  • @webdecoy/express README: install @webdecoy/node too (rules are imported from it), local-rules example with req.webdecoyDecision, onBlocked documented as server-score blocks only (rule refusals answer 403/429 directly), verify step.
  • Root README: apiUrl default is https://in.webdecoy.com (sdk.ts), API Keys page wording, tripwires no longer called "zero-FP", unsourced "50-200ms" and "runs asynchronously" FAQ replaced with what the code does (server call only when local analysis flags a request; awaited, bounded by timeout, fails open).
  • new WebDecoy() with no argument throws at runtime (config.apiKey on undefined); the root README and docs/verify-ai-agents-web-bot-auth.md now pass {}.
  • CHANGELOG [Unreleased] entry.

Snippets are consistent with docs.webdecoy.com/installation/install-with-ai (WebDecoy/app#1745).

Verification

  • Every snippet type-checked with tsc --strict against the built packages.
  • Runtime smoke test without an API key: Express, Fastify and Hono all return DENY / deniedBy('tripwire') === true for /.env and ALLOW for /; Hono in enforce mode answers 403.
  • npm pack --dry-run includes README.md in all six packages (npm always includes it; no files change needed).
  • npm run build, npm run lint, npm test, npm run check:edge all pass.

npm pages update only with the next published version.

Add READMEs to @webdecoy/fastify, @webdecoy/nextjs and @webdecoy/hono,
whose npm pages were blank. Rewrite the @webdecoy/node README for the
current API: apiKey is optional, protect() returns a Decision
(conclusion, results, deniedBy), adapters start in monitor mode, and
WEBDECOY_API_KEY is never read from the environment.

Root README: apiUrl default is https://in.webdecoy.com, keys come from
the API Keys page, tripwires are no longer called zero-FP, and the
unsourced latency figure is replaced by what the code does. Express
install now adds @webdecoy/node, where the rules are imported from.
new WebDecoy() without a config throws, so examples pass {}.
@cport1
cport1 merged commit 5682914 into main Nov 10, 2026
2 checks passed
@cport1
cport1 deleted the docs/readmes branch November 10, 2026 16:30
@cport1 cport1 mentioned this pull request Nov 10, 2026
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.

1 participant