Skip to content

Quickstart

Gatefit checks your access DB, not Stripe HTTP 200. Node 22+.

Export createAdapter() (or default) with:

  • apply(event) — ingest one billing event
  • snapshot(customerId) — return { locked, plan?, seats?, features? }
  • reset() — required when running more than one golden

locked: true means deny even if Stripe looks paid. Compare is declared-fields-only.

Reference: src/adapters/sqlite.ts in the repo. Anti-pattern: src/adapters/naive.ts (HTTP 200 as access).

Longer contract: bring-your-adapter.md.

npm is coming soon. After npm publish:

Terminal window
npx gatefit --version
npx gatefit adapter-check
npx gatefit run --suite paid_grants_access --adapter ./src/your-access-adapter.ts

From a clone until the package is on the registry:

Terminal window
npm install
node bin/gatefit.js adapter-check
node bin/gatefit.js run --suite tests/entitlements/goldens --adapter ./src/your-access-adapter.ts

Exit 0 means the goldens passed against that adapter.

In the Gatefit repo:

Terminal window
bash ./ci-local.sh

Do not set GATEFIT_LIVE_CLOCK for this gate. Do not use sk_live. Live Test Clocks are opt-in and documented in the repo.

See GitHub Action.