Skip to main content
Owners and signers 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 requires a user owner or user signer, make sure to request the user key before signing requests with it.
  • NodeJS
  • NodeJS (server-auth)
  • Java
  • Go, Python, Rust, Vanilla TS
  • React, Expo
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.
  • Automatic signing
  • Utility functions
You can set the authorization context to use an authorization key, by using authorization_private_keys.
const authorizationContext: AuthorizationContext = {
  authorization_private_keys: ["authorization-key"]
};
Wallet requests on the wallets can now be made by passing in this newly created authorization context on the call to the PrivyClient.
Example: Sign a message with the wallet
try {
  const message = "Hello, Ethereum.";

  const response = await privyClient.wallets()
    .ethereum()
    .signMessage(P256_OWNED_ETHEREUM_WALLET_ID, {
      message,
      authorization_context: {
        authorization_private_keys: ["authorization-key"]
      }
    });

  const signature = response.signature;
} catch (error) {
  console.error(error);
}