@tagadapay/radar
v0.1.0
Published
Tagada Radar: reports the website a payment comes from, and gives it a token.
Keywords
Readme
@tagadapay/radar
Reports the website a payment comes from, and gives the payment a token. No runtime dependency.
Not the Stripe or Airwallex fraud session of packages/core-js/src/radar, and not requireAction: "radar": those are a processor's fraud check. This one proves the payment's origin to the Payments API.
Layout
src/core: Radar itself, with no global, browser API or network. Its environment and transport are given.src/browser: the browser environment, the fetch transport, andloadRadar, which keeps one instance per page and per key onwindow.src/script.ts: the script tag entry, built todist/radar.min.js.
What it sends
POST {apiBase}/v1/radar/tokens with the publishable key, the path without its query string, the referrer without its query string, and a tab session id. The website and the user agent are the browser's own Origin and User-Agent headers. It reads no form, no field and no page content; src/__tests__/bundle.test.ts fails if the bundle gains the means to.
Commands
pnpm --filter @tagadapay/radar test, type-check, build. The bundle budget (5 KB gzipped) is a test.
Embedding it in another package later
Import createRadar from @tagadapay/radar/core and pass your own environment and transport, or re-export loadRadar. Copies on one page share one instance per key through window.__tagadaRadar. This package must keep depending on nothing.
The server side and what enforcement does and does not prove: apps/payments-api/docs/25-radar.md.
