Owners sign requests to the Privy API to take actions on a resource, like a wallet or a policy. Follow the guide below to learn how to sign requests to the Privy API.
If the desired resource has a user owner, make sure to request the user key before signing requests with it.
Privy’s NodeJS SDK both:
  • automatically signs requests with a private key you provide and includes the signature in request headers when you invoke methods on the Privy client, enabling a more managed integration.
  • exports lower-level utility functions for generating signatures, for more custom and complex setups such as distributed key quorums.
Follow the guide below that corresponds to your desired integration in a NodeJS environment.
Privy’s NodeJS SDK automatically handles signing requests with your provided key. You can specify which key to sign with using the updateAuthorizationKey method of the Privy client.Pass the base-64 encoded private key of your user key or authorization key into the Privy client’s updateAuthorizationKey method:
privy.walletApi.updateAuthorizationKey('insert-base64-encoded-private-key')
The Privy client will now automatically sign requests to the Privy API with the provided key. You can simply use the privy.walletApi.ethereum.* and privy.walletApi.solana.* interfaces to take actions with wallets, and the SDK will automatically sign requests under the hood.