Prerequisites

Before you begin:

Instantiating the PrivyClient

Import the PrivyClient struct and create an instance by passing your Privy app ID and app secret as parameters.
use privy_rs::PrivyClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = PrivyClient::new(
        "insert-your-app-id".to_string(),
        "insert-your-app-secret".to_string()
    )?;

    Ok(())
}
Store your credentials as environment variables for security:
let app_id = std::env::var("PRIVY_APP_ID")
    .expect("PRIVY_APP_ID environment variable not set");
let app_secret = std::env::var("PRIVY_APP_SECRET")
    .expect("PRIVY_APP_SECRET environment variable not set");

let client = PrivyClient::new(app_id, app_secret)?;
This client PrivyClient is now your entry point to manage Privy from your server. With the PrivyClient you can interact with wallets with methods for creating wallets, signing and sending transactions. You can also manage users with methods for getting a user object, verifying an auth token, and importing new users.

Rate limits

Privy rate limits REST API endpoints that you may call from your server. If you suspect your team will require an increased rate limit, please reach out to support!
Learn more about optimizing your setup in our optimizing guide!