> ## Documentation Index
> Fetch the complete documentation index at: https://docs.privy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Configure the Privy Ruby SDK client with app credentials and authorization context for backend operations.

## Prerequisites

Before getting started:

* Obtain a [Privy app ID and app secret](/basics/get-started/dashboard/create-new-app) from the Privy Dashboard
* Install Ruby 3.2.0 or later

## Instantiating the `PrivyClient`

Require the `privy` gem and create a new client instance by passing the Privy **app ID** and
**app secret** as parameters.

```ruby theme={"system"}
require "privy"

client = Privy::PrivyClient.new(
  app_id: "your-privy-app-id",
  app_secret: "your-app-secret"
)
```

This `client` is the entry point for managing Privy resources from a server. The `PrivyClient`
provides services for creating wallets, signing and sending transactions, retrieving user objects,
verifying auth tokens, and managing policies and key quorums.

<Tip>
  The `app_id` and `app_secret` arguments default to the `PRIVY_APP_ID` and `PRIVY_APP_SECRET`
  environment variables, so they can be omitted if those variables are set.
</Tip>

## Authorization

If a resource (i.e. wallet, policy, or key quorum) has an [owner](/controls/authorization-keys/using-owners/overview),
[authorization signatures](/api-reference/authorization-signatures) from the owner are required.
The [authorization context](/controls/authorization-keys/using-owners/sign/signing-on-the-server) accepts authorization private keys
and user JWTs of the wallet's owners. The Ruby SDK generates signatures and signs requests
automatically.

<Tip>
  Review the [signing on the
  server](/controls/authorization-keys/using-owners/sign/signing-on-the-server) guide before using
  the Ruby SDK for the best development experience.
</Tip>

```ruby theme={"system"}
ctx = Privy::Authorization::AuthorizationContext.build(
  authorization_private_keys: ["privateKey1", "privateKey2"],
  user_jwts: ["jwt1", "jwt2"]
)
```

## Rate limits

Privy rate limits REST API endpoints called from a server.

<Tip>
  Learn more about optimizing request patterns and handling rate limits in the
  [optimizing](/recipes/dashboard/optimizing) guide.
</Tip>

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/basics/ruby/quickstart">
    Create wallets, sign messages, and send transactions with the Ruby SDK.
  </Card>

  <Card title="Authorization keys" icon="key" href="/controls/authorization-keys/overview">
    Add an extra layer of security by signing requests with authorization keys.
  </Card>
</CardGroup>
