@freezeradar/widget
v1.0.0
Published
Embeddable FreezeRadar wallet freeze/sanctions check widget — ESM/UMD, React, and web component wrappers
Maintainers
Readme
@freezeradar/widget
Distribution package for the FreezeRadar embeddable wallet freeze / sanctions check widget.
This repo does not rebuild the product UI from scratch. It wraps the official https://freezeradar.com/widget.js embed and offers a tiny inline fallback that calls GET /api/widget/check.
What’s included
| Surface | Path |
| --- | --- |
| npm package @freezeradar/widget | ESM + CJS + IIFE (dist/), TypeScript types |
| React component | @freezeradar/widget/react → <FreezeRadarWidget /> |
| Web component | <freezeradar-widget> (auto-registered from the main entry) |
| WordPress plugin | wordpress/freezeradar-widget/ (GPLv2-or-later headers for WordPress.org) |
Repo license is MIT (copyright FreezeRadar). The WordPress plugin PHP headers and readme.txt use GPLv2 or later, as required by WordPress.org — see Listing / distribution steps.
Setup
npm install
npm run lint
npm test
npm run buildZip the WordPress plugin:
npm run zip:wordpress
# → dist/freezeradar-widget.zipUsage (npm)
Script tag (official host)
The live embed looks for #freezeradar-widget and optional data-theme / data-chains:
<div id="freezeradar-widget" data-theme="light" data-chains="ethereum"></div>
<script src="https://freezeradar.com/widget.js" async></script>mount(element, options)
import { mount } from "@freezeradar/widget";
const el = document.getElementById("check")!;
const handle = mount(el, {
mode: "inline", // or "script" to load versioned widget.js
theme: "auto",
chain: "ethereum",
});
handle.destroy();| Option | Default | Notes |
| --- | --- | --- |
| mode | "script" | "script" loads versioned official JS; "inline" renders a minimal equivalent |
| theme | "auto" | dark | light | auto |
| chain / chains | — | Fixed chain when a single value is set |
| apiBase | https://freezeradar.com | API + script origin |
| useQuickCheck | false | Optional POST /api/v1/quick-check (inline mode only) |
| apiKey | — | Bearer key for quick-check — do not ship in public bundles |
| poweredBy | true | Show “Powered by FreezeRadar” |
React
import { FreezeRadarWidget } from "@freezeradar/widget/react";
export function Page() {
return <FreezeRadarWidget mode="inline" theme="light" chain="tron" />;
}Web component
<script type="module" src="https://cdn.jsdelivr.net/npm/@freezeradar/widget/dist/index.js"></script>
<freezeradar-widget mode="inline" theme="dark" chain="ethereum"></freezeradar-widget>Configuration & APIs
Public (no key, CORS *):
GET /api/widget/check?address=…&chain=…→{ ok, data: { address, chain, blacklisted, sanctioned } }- Full report:
https://freezeradar.com/scan?address=…
Optional authenticated (off by default):
POST /api/v1/quick-checkwithAuthorization: Bearer <api key>, body{ address, chain? }- Falls back to the public widget check on any failure
Fail-open: if the API is unreachable or returns an unexpected body, the UI shows a warning and never treats the address as blocked by network failure.
Never send private keys or seed phrases. This package only accepts public addresses.
WordPress plugin
- Install from
dist/freezeradar-widget.zipor copywordpress/freezeradar-widget/intowp-content/plugins/. - Activate FreezeRadar Widget.
- Settings → FreezeRadar Widget (default chain, theme; optional “Powered by FreezeRadar” credit is off by default).
- Shortcode:
[freezeradar_widget chain="ethereum" theme="light"] - Or insert the FreezeRadar Widget Gutenberg block.
The plugin enqueues the official script, escapes all output, and does not add tracking. The public credit link is opt-in only (WordPress.org Guideline 10).
Listing / distribution steps
Owner checklist for npm and WordPress.org lives in docs/LISTING.md.
Scripts
| Script | Purpose |
| --- | --- |
| npm run build | Bundle ESM/CJS/IIFE + types via tsup |
| npm test | Vitest |
| npm run lint | ESLint |
| npm run zip:wordpress | Zip plugin to dist/ |
License
MIT for this repository. WordPress plugin headers / readme.txt are GPLv2-or-later for WordPress.org compatibility.
