Skip to main content

Recommended: JavaScript SDK with React Hooks

For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
Server-only
This page covers your server webhook handler. The client triggers delegation; your server verifies, decrypts, and stores materials.
When a delegation is triggered, your endpoint receives a webhook named wallet.delegation.created. The delegated materials are in data.

Verify → Decrypt → Store

  1. Verify the webhook signature. Use your webhook secret and the x-dynamic-signature-256 header: compute HMAC-SHA256 of the raw request body with the secret and compare to the header value in constant time. Only proceed if the signature is valid.
The payload you pass to verifySignature must match exactly how it was sent (same JSON structure); otherwise verification will fail.
  1. Decrypt data.encryptedDelegatedShare and data.encryptedWalletApiKey.
  2. Store userId, walletId, and decrypted materials securely (e.g., envelope encryption, KMS, at-rest encryption).
Encryption fields
alg: hybrid (RSA‑OAEP + AES‑256‑GCM); iv: AES IV; ct: ciphertext; tag: GCM tag; ek: encrypted content‑encryption key; kid: key identifier for rotation.

Example: Node (using Dynamic SDK)

We provide a helper function to handle decryption for you. Install the SDK:
Then use the decryptDelegatedWebhookData function:
If a delivery fails, you can replay it from the dashboard. Use the eventId as an idempotency key.

Storage Best Practices

Learn how to securely store decrypted delegated materials.

Developer Actions

Learn how to use the delegated materials.
Last modified on June 25, 2026