> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SDK Overview

> Install the Rain SDK, authenticate with your API key, and make your first API call in TypeScript, Go, or Python.

Use the Rain SDK to interact with the Rain API in TypeScript, Go, or Python. You get full type safety, IDE autocomplete, and a consistent interface across every language.

Follow these steps to go from SDK installation to your first call:

<Steps>
  <Step title="Install the SDK">
    In your terminal, run:

    <CodeGroup>
      ```bash TypeScript theme={null}
      npm install @rainapi/rain-sdk
      ```

      ```bash Go theme={null}
      go get -u github.com/SignifyHQ/rain-sdk-go@v0.1.0
      ```

      ```bash Python theme={null}
      pip install rain-sdk
      ```
    </CodeGroup>

    <Info>
      The SDK is optional. You can make all the same calls directly to the Rain REST API using any HTTP client. See [Authenticating with the API](/reference/authenticating-with-the-api) for details.
    </Info>
  </Step>

  <Step title="Initialize the client">
    Create a client instance by passing your API key and choosing your environment. Your API key defaults to the `RAIN_API_KEY` environment variable.

    <CodeGroup>
      ```ts TypeScript theme={null}
      import Rain from '@rainapi/rain-sdk';

      const client = new Rain({
        apiKey: process.env['RAIN_API_KEY'],
        environment: 'dev', // use 'production' for live
      });
      ```

      ```go Go theme={null}
      package main

      import (
      	"context"
      	"fmt"
      	"os"

      	rainsdk "github.com/SignifyHQ/rain-sdk-go"
      	"github.com/SignifyHQ/rain-sdk-go/option"
      )

      func main() {
      	client := rainsdk.NewClient(
      		option.WithAPIKey(os.Getenv("RAIN_API_KEY")),
      		option.WithEnvironmentDev(), // use option.WithEnvironmentProduction() for live
      	)
      	_ = client
      }
      ```

      ```python Python theme={null}
      from rain_sdk import Rain

      client = Rain(
          api_key="your-api-key",  # defaults to RAIN_API_KEY env var
          environment="dev",       # use "production" for live
      )
      ```
    </CodeGroup>

    | Parameter     | Default                | Description                                                      |
    | ------------- | ---------------------- | ---------------------------------------------------------------- |
    | `apiKey`      | `RAIN_API_KEY` env var | Your API key from the [Developer Dashboard](/docs/set-up-access) |
    | `environment` | `dev`                  | `'dev'` for sandbox, `'production'` for live                     |

    In Go, select the environment with `option.WithEnvironmentDev()` or `option.WithEnvironmentProduction()` instead of a string.
  </Step>

  <Step title="Make your first call">
    List your companies to verify the SDK is working:

    <CodeGroup>
      ```ts TypeScript theme={null}
      const companies = await client.companies.list();
      console.log(companies);
      ```

      ```go Go theme={null}
      companies, err := client.Companies.List(context.TODO(), rainsdk.CompanyListParams{})
      if err != nil {
      	panic(err)
      }
      fmt.Println(companies)
      ```

      ```python Python theme={null}
      companies = client.companies.list()
      print(companies)
      ```
    </CodeGroup>
  </Step>
</Steps>

## Explore the API

The SDK organizes all endpoints into resource namespaces that mirror the [API Reference](/reference/rain-api):

| Namespace             | Description                                |
| --------------------- | ------------------------------------------ |
| `client.applications` | Submit and manage KYC/KYB applications     |
| `client.balances`     | Retrieve credit balances                   |
| `client.cards`        | Create, update, and list cards             |
| `client.companies`    | Manage companies, users, and payments      |
| `client.contracts`    | View smart contract details                |
| `client.disputes`     | File and manage disputes                   |
| `client.keys`         | Create and delete API keys                 |
| `client.payments`     | Initiate payments                          |
| `client.signatures`   | Retrieve payment and withdrawal signatures |
| `client.transactions` | List, filter, and update transactions      |
| `client.users`        | Create and manage users                    |

<Info> Type `client.` in your IDE to see all available namespaces, then type `client.cards.` to see the methods on that resource. Every method maps directly to an endpoint in the [API Reference](/reference/rain-api). </Info>

In Go, namespaces are PascalCase fields on the client: `client.Cards`, `client.Transactions`, `client.Applications.User`, and so on.

## Type safety

Import request and response types for full type safety. In Go, optional fields use `param.Opt[T]` wrappers — construct them with helpers like `rainsdk.String(...)` and `rainsdk.Int(...)`, and check response field presence with `.JSON.<Field>.Valid()`.

<CodeGroup>
  ```ts TypeScript theme={null}
  import Rain from '@rainapi/rain-sdk';

  // Request params
  const params: Rain.UserCreateCardParams = {
    type: 'virtual',
    limit: { amount: 50000, frequency: 'per30DayPeriod' },
  };

  // Response types
  const card: Rain.IssuingCard = await client.users.createCard(userId, params);
  console.log(card.last4, card.status);
  ```

  ```go Go theme={null}
  // Request params
  params := rainsdk.UserNewCardParams{
  	Type: rainsdk.UserNewCardParamsTypeVirtual,
  	Limit: rainsdk.IssuingCardLimitParam{
  		Amount:    50000,
  		Frequency: rainsdk.IssuingCardLimitFrequencyPer30DayPeriod,
  	},
  }

  // Response types
  card, err := client.Users.NewCard(context.TODO(), userID, params)
  if err != nil {
  	panic(err)
  }
  fmt.Println(card.Last4, card.Status)
  ```
</CodeGroup>

## What's next

<Columns cols={3}>
  <Card title="Configuration" icon="gear" href="/sdks/configuration">
    Set up error handling, retries, timeouts, and logging.
  </Card>

  <Card title="Card Issuance" icon="credit-card" href="/sdks/card-issuance">
    Issue your first card end-to-end with the SDK.
  </Card>

  <Card title="Embedded Wallets" icon="mobile" href="/sdks/embedded-wallets-overview">
    Add non-custodial embedded wallets to your Android or iOS app.
  </Card>
</Columns>
