OpenZeppelin Defender will sunset on July 1, 2026. As a result, this SDK will be deprecated and will no longer receive updates after that date.
Users are encouraged to migrate to OpenZeppelin's open source projects, including OpenZeppelin Relayer and OpenZeppelin Monitor. For detailed migration instructions and guidance, please follow the Defender Migration Guide.
Note on OZ Monitor: While this defender-sdk includes a Defender Monitor client, OpenZeppelin Monitor (the open source version) is a standalone binary/CLI tool and does not ship with a client SDK.
OpenZeppelin Relayer SDK: For relayer functionality, use the new OpenZeppelin Relayer SDK.
This monorepo contains individual OpenZeppelin Defender TypeScript clients and publishes the collection of clients as @openzeppelin/defender-sdk
For detailed instructions on how to use the SDK, please refer to our SDK Documentation.
-
pnpmfor workspaces & dependency management. -
nxfor build & tests. -
changesetsfor versioning, changelog management & publishing. -
Checkout the repo and run
pnpm i --ignore-scripts --prefer-offline && pnpm run build.Install pnpm globally with
npm i -g pnpmif you haven't already. -
To skip cache on the subsequent build steps you can use
pnpm nx-build-skip-cache.
- Run
pnpm nx-test-skip-cacheto run unit tests across all packages.
- Run
pnpm lint:checkorpnpm prettier:checkat the project root. For fixingpnpm lint:fix
- Run
pnpm nx-build-test-skip-cache.
The examples repo has sample code - note that most examples rely on dotenv for loading API keys and secrets.
You can set the following environment variables to control to which instance your client will connect to:
# all modules/clients besides relay signer
DEFENDER_API_URL=
DEFENDER_POOL_ID=
DEFENDER_POOL_CLIENT_ID=
# relay signer
DEFENDER_RELAY_SIGNER_API_URL=
DEFENDER_RELAY_SIGNER_POOL_ID=
DEFENDER_RELAY_SIGNER_POOL_CLIENT_ID=- We use slsa framework pronounced "salsa" for reproducible builds & secure pushes. Verification is done using provenance