Official JavaScript/TypeScript SDK for the WebFry API.
npm install webfry-sdk- Node.js 18+
import { WebfryClient } from "webfry-sdk";
const client = new WebfryClient({
baseUrl: "https://webfry.dev",
apiKey: process.env.WEBFRY_API_KEY,
});
const info = await client.userInfo();
console.log(info.plan, info.api_usage);Most endpoints require X-API-Key.
const client = new WebfryClient({ baseUrl: "https://webfry.dev" });
const { api_key } = await client.getApiKey({ email, password });
client.setApiKey(api_key);UI naming:
- Starter Plan
- Pro Plan
- Enterprise Plan (enterprise)
Internal API plan values in responses:
starter-> Starterpro-> Pro
Starter limit is currently 100 requests/month.
SDK throws WebfryApiError for non-2xx responses.
import { WebfryClient, WebfryApiError } from "webfry-sdk";
try {
await client.passwordCheck({ password: "test" });
} catch (err) {
if (err instanceof WebfryApiError) {
console.error(err.status, err.message, err.payload);
}
}new WebfryClient({
baseUrl: "https://webfry.dev", // default
apiKey: "wf_...", // optional
timeoutMs: 15000, // default 15s
fetchImpl: fetch // optional custom fetch
});getApiKey({ email, password })rotateApiKey()userInfo()setApiKey(apiKey)clearApiKey()
passwordCheck({ password })commonPassword({ password })entropy({ password })
hashLookup({ hashes })hashLookupSite({ hashes })hashGenerator({ algorithm, plaintext })hashIdentifier({ hash })
base64({ text, option: "encode" | "decode" })generateRandomKey()jwtDecoder({ token })secureEncrypt({ text, password })secureDecrypt({ text, password })jsonFormat({ text })jsonMinify({ text })suggestion({ message, email? })
ipInfo({ ip_string })dataBreach({ ip_string })
These endpoints currently depend on backend release gating and may return construction messages.
examples/get-key.mjsexamples/node-basic.mjs
npm install
npm run build- Do not expose your API key in browser bundles.
- Use server-side execution for sensitive workflows.
- Rotate leaked keys immediately.
- API Docs: https://webfry.dev/api-docs
- OpenAPI: https://webfry.dev/docs_static/openapi.yaml