Configuring server sessions

At a high-level, setting up server sessions for your app involves three steps:

1

Enable server sessions

Enable server sessions within the Privy Dashboard to allow your app to request permission from users to transact on their behalf.

2

Generate an authorization key

(Optional, but strongly recommended) Within the Privy Dashboard, when enabling server sessions, generate an authorization keypair to ensure that actions with user’s wallets are only taken with requests signed by your app’s servers.

3

Prompt users to grant consent

Within your client (web or native mobile app), prompt the user to provision a server session for their wallet.

Enable server sessions

To enable server sessions for your app, visit the Privy Dashboard and navigate to the User management > Authentication page for your app.

Select the Advanced tab and toggle the Delegated actions setting to enable server sessions for your app.

Generate an authorization key

Once you’ve enabled delegated actions, you can further secure your integration by generating an authorization key that is required to sign requests.

To generate an authorization key, under the toggle to enable delegated actions, enable the Require signed requests setting. A modal will appear with a Signing key to copy. Copy this value and save it securely in a secrets manager or similar.

With this setting enabled, all requests to take delegated actions with user’s wallet must be signed with your Signing key. This ensures that Privy only ever executes requests sent by your server.

Privy never sees this private key and cannot help you recover it.

The authorization key is the private key of a P-256 keypair. Privy never sees the private key, and verifies signatures on your requests against the corresponding public key to ensure your server authorizes the action to take with a user’s delegated wallet.

Configuring permissions

To configure permissions to control what kinds of actions your app can take with server session provisioned wallets, you can set up new policies for your server session key in your Privy dashboard under Wallet infrastructure > Policies.

Provisioning server sessions

To use server sessions, your user must first grant consent for your app to take certain actions on their behalf. To have users grant consent, follow the guides below depending on the client-side SDK(s) you integrate.