OpenWAF has two official API clients, generated from the same OpenAPI contract as the API reference:
| SDK | File | Runs on | Dependencies |
|---|---|---|---|
| TypeScript / JavaScript | openwaf.ts | Bun, Deno, Node.js with TypeScript type stripping, browsers and any TypeScript toolchain; built on fetch | None |
| Python | openwaf.py | Python 3.8 or later | None (standard library) |
Each SDK is a single file that you download from the API itself and keep in your project. It has one method per API operation that an API token can call, with typed parameters and answers, and the same change protocol as the dashboard and the CLI: a reason on every write, simulation with a dry run, and the expected version.
import { OpenWAF } from "./openwaf.ts";
const owf = new OpenWAF({ baseUrl: "https://dash.openwaf.dev" }); // token from OPENWAF_TOKEN
const { items = [] } = await owf.listZones();
for (const z of items) console.log(z.name, z.status, z.config_version);from openwaf import OpenWAF
owf = OpenWAF(base_url="https://dash.openwaf.dev") # token from OPENWAF_TOKEN
for z in owf.list_zones()["items"]:
print(z["name"], z["status"], z["config_version"])Get starteddownload the SDK, configure a token and list your zones.How the SDKs are generatedwhere the files come from and how methods map to API operations.Authentication and configurationtoken, API address and organisation.Writes: reason, simulation and versionthe change protocol from code.Error handling
OpenWAFError, its codes and version conflicts.Paginationpage through version history and the audit log.Create a DNS recordsimulate, review and confirm a change.Purge the cachepurge URLs after a deployment.TypeScript referenceclient options, method conventions, errors and types.Python referenceconstructor, method conventions, errors and return values.