Skip to main content

Dynamic Integration

Dynamic provides wallet connection, embedded wallets, and multi-chain auth for web3 apps. You can use Dynamic as your auth provider for Privacy Boost, letting users log in through Dynamic’s UI while using Privacy Boost for private transactions.

How It Works

Dynamic authenticates your users and issues JWTs. The SDK can attach the raw Dynamic JWT to Privacy Boost’s login flow directly, and Privacy Boost validates it against Dynamic’s JWKS endpoint using the custom_jwt auth method. Dynamic Authentication Flow

Server-Side Setup

Your app must be configured with the custom_jwt auth method. Contact the Privacy Boost team with:
  • JWKS URL — Dynamic’s JWKS endpoint for your environment: https://app.dynamic.xyz/api/v0/sdk/<YOUR_ENVIRONMENT_ID>/.well-known/jwks
  • Issuer — Required expected iss claim: app.dynamic.xyz/<YOUR_ENVIRONMENT_ID>
  • Audience — Required expected aud claim from your Dynamic access token. This is the token audience, not the environment_id claim.
The backend configuration looks like:
Find your Environment ID in the Dynamic Dashboard under Developer > SDK & API Keys. Decode a representative Dynamic access token and configure audience to match its exact aud claim. Do not use the environment_id claim unless your token’s aud is actually the same value.

Client-Side Integration

1. Set Up Dynamic

Follow Dynamic’s React quickstart to set up DynamicContextProvider:

2. Configure Privacy Boost for Direct IdP Auth

Browser IdP callbacks are only supported in local key-vault mode. The default browser mode is the isolated iframe vault, which intentionally does not accept host-page token callbacks.

3. Create an External Token Callback

The callback returns the raw Dynamic auth token. The SDK attaches it to both the /auth/login bootstrap and /auth/token exchange:

4. Authenticate with Privacy Boost

Optional: Backend Relay Instead

If you prefer to keep all auth exchanges behind your own backend, use tokenProvider instead of getExternalToken. The options are mutually exclusive. Your backend receives the SDK’s login payload, and forwards to Privacy Boost with the Dynamic JWT:

Using Dynamic’s Wallet Connector

If your users connect wallets through Dynamic, you can use the connected wallet’s provider with the Privacy Boost SDK:

Next Steps

Continue with setup: Or explore other auth methods:
  • Custom JWT — For Auth0, Firebase, Supabase, Clerk, or OIDC providers
  • Privy — For Privy social login and embedded wallets