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

# Official SDKs

> Official Dodo Payments SDKs for TypeScript, Python, Go, PHP, Java, Kotlin, C#, Ruby, and Rust, plus checkout SDKs for mobile apps.

Official Dodo Payments server SDKs are available in nine languages. Separate checkout SDKs open hosted checkout from Android, iOS, React Native, and Flutter apps.

<CardGroup cols={3}>
  <Card title="TypeScript" icon="js" href="/developer-resources/sdks/typescript">
    Type-safe SDK for Node.js with promise-based API and auto-pagination.
  </Card>

  <Card title="Python" icon="python" href="/developer-resources/sdks/python">
    Pythonic interface with async/await support for Python 3.9+.
  </Card>

  <Card title="Go" icon="golang" href="/developer-resources/sdks/go">
    Idiomatic Go interface with context support and strong typing.
  </Card>

  <Card title="PHP" icon="php" href="/developer-resources/sdks/php">
    PSR-4 compliant SDK for PHP 8.1+.
  </Card>

  <Card title="Java" icon="java" href="/developer-resources/sdks/java">
    Thread-safe SDK for Java 8+ with Maven and Gradle support.
  </Card>

  <Card title="Kotlin" icon="android" href="/developer-resources/sdks/kotlin">
    Kotlin SDK with coroutines and null safety.
  </Card>

  <Card title="C#" icon="hashtag" href="/developer-resources/sdks/csharp">
    Type-safe SDK for .NET Standard 2.0+ with async Task-based API.
  </Card>

  <Card title="Ruby" icon="gem" href="/developer-resources/sdks/ruby">
    Ruby SDK that follows Ruby conventions.
  </Card>

  <Card title="Rust" icon="rust" href="/developer-resources/sdks/rust">
    Async-first SDK built on Tokio and reqwest for Rust 1.75+.
  </Card>
</CardGroup>

## Quick Start

<Steps>
  <Step title="Install the SDK">
    Install the SDK for your language with its package manager.

    <Tabs>
      <Tab title="TypeScript">
        ```bash theme={null}
        npm install dodopayments
        ```
      </Tab>

      <Tab title="Python">
        ```bash theme={null}
        pip install dodopayments
        ```
      </Tab>

      <Tab title="Go">
        ```bash theme={null}
        go get github.com/dodopayments/dodopayments-go
        ```
      </Tab>

      <Tab title="PHP">
        ```bash theme={null}
        composer require dodopayments/client
        ```
      </Tab>

      <Tab title="Java">
        ```kotlin theme={null}
        // build.gradle.kts
        implementation("com.dodopayments.api:dodo-payments-java:1.118.0")
        ```
      </Tab>

      <Tab title="Kotlin">
        ```kotlin theme={null}
        // build.gradle.kts
        implementation("com.dodopayments.api:dodo-payments-kotlin:1.118.0")
        ```
      </Tab>

      <Tab title="C#">
        ```bash theme={null}
        dotnet add package DodoPayments.Client
        ```
      </Tab>

      <Tab title="Ruby">
        ```bash theme={null}
        bundle add dodopayments
        ```
      </Tab>

      <Tab title="Rust">
        ```bash theme={null}
        cargo add dodopayments
        ```
      </Tab>
    </Tabs>

    For Maven coordinates and version-specific options, see each SDK's page.
  </Step>

  <Step title="Initialize the Client">
    Read your API key from the `DODO_PAYMENTS_API_KEY` environment variable. The examples connect to test mode; see [Test Mode vs Live Mode](/miscellaneous/test-mode-vs-live-mode).

    <Tabs>
      <Tab title="TypeScript">
        ```typescript theme={null}
        import DodoPayments from 'dodopayments';

        const client = new DodoPayments({
          bearerToken: process.env.DODO_PAYMENTS_API_KEY,
          environment: 'test_mode',
        });
        ```
      </Tab>

      <Tab title="Python">
        ```python theme={null}
        import os
        from dodopayments import DodoPayments

        client = DodoPayments(
            bearer_token=os.environ["DODO_PAYMENTS_API_KEY"],
            environment="test_mode",
        )
        ```
      </Tab>

      <Tab title="Go">
        ```go theme={null}
        import (
            "os"

            "github.com/dodopayments/dodopayments-go"
            "github.com/dodopayments/dodopayments-go/option"
        )

        client := dodopayments.NewClient(
            option.WithBearerToken(os.Getenv("DODO_PAYMENTS_API_KEY")),
            option.WithEnvironmentTestMode(),
        )
        ```
      </Tab>

      <Tab title="PHP">
        ```php theme={null}
        use Dodopayments\Client;

        $client = new Client(
            bearerToken: getenv('DODO_PAYMENTS_API_KEY'),
            baseUrl: 'https://test.dodopayments.com',
        );
        ```
      </Tab>

      <Tab title="Rust">
        ```rust theme={null}
        use dodopayments::{Client, ClientConfig, Environment};

        let config = ClientConfig::from_env()
            .expect("DODO_PAYMENTS_API_KEY must be set")
            .with_environment(Environment::TestMode);
        let client = Client::new(config).expect("failed to create client");
        ```
      </Tab>
    </Tabs>

    For Java, Kotlin, C#, and Ruby, see the client setup on each SDK's page.

    <Warning>
      Keep API keys in environment variables or a secrets manager. Never commit them to version control.
    </Warning>
  </Step>

  <Step title="Create a Checkout Session">
    Create a checkout session and redirect the customer to the returned `checkout_url`.

    ```typescript theme={null}
    const session = await client.checkoutSessions.create({
      product_cart: [{ product_id: 'YOUR_PRODUCT_ID', quantity: 1 }],
    });

    console.log(session.checkout_url);
    ```

    For the same call in other languages, and for payment links and webhooks, see the [Integration Guide](/developer-resources/integration-guide).
  </Step>
</Steps>

## Key Features

All backend SDKs include:

* **Type Safety**: Strong typing for compile-time safety and better IDE support.
* **Error Handling**: Typed errors that expose the HTTP status and the error body the API returned.
* **Authentication**: API key authentication, read from an environment variable.
* **Async Support**: Modern async/await patterns where applicable.
* **Auto-Pagination**: Automatic pagination for list responses.
* **Usage Events**: Methods to send usage events for usage-based billing.
* **Test Mode**: A setting that points the client at test mode, so no real money moves.

## Mobile Checkout SDKs

For native Android, iOS, React Native, and Flutter apps, use the mobile checkout SDKs. They open Dodo's hosted checkout page in the platform's real browser surface (not a WebView), so Apple Pay and Google Pay work the same way they do on the open web.

All four mobile SDKs share the same contract: `start(...)` returns a typed `CheckoutResult`, none of them hold an API key, and they never call the API directly.

<CardGroup cols={2}>
  <Card title="Android" icon="android" href="/developer-resources/sdks/android">
    Kotlin SDK that opens a Chrome Custom Tab. Requires `minSdk` 23.
  </Card>

  <Card title="iOS" icon="apple" href="/developer-resources/sdks/ios">
    Swift SDK that opens SFSafariViewController. Requires iOS 16+.
  </Card>

  <Card title="React Native" icon="react" href="/developer-resources/sdks/react-native">
    Turbo Module over both native cores. Requires React Native 0.76+.
  </Card>

  <Card title="Flutter" icon="layer-group" href="/developer-resources/sdks/flutter">
    Pigeon channel over both native cores. Requires Flutter 3.44+.
  </Card>
</CardGroup>

<Card title="Mobile Integration Guide" icon="mobile" href="/developer-resources/mobile-integration">
  End-to-end mobile payment flow, from backend checkout session to callback scheme setup.
</Card>

## Command-Line Interface

The Dodo CLI manages payments, customers, and webhooks from your terminal. It includes an interactive TUI, an AI assistant, and webhook testing tools.

<Card title="CLI" icon="terminal" href="/developer-resources/sdks/cli">
  Interactive terminal client with AI assistant and webhook testing.
</Card>

Install it on macOS or Linux with:

```bash theme={null}
curl -fsSL https://dodopayments.com/install.sh | sh
```

## Framework Adaptors

Adaptors add checkout, customer portal, and webhook handlers to your framework.

### Recommended Frameworks

<CardGroup cols={2}>
  <Card title="Next.js" icon="atom" href="/developer-resources/nextjs-adaptor">
    Route handlers for checkout, customer portal, and webhooks in the App Router.
  </Card>

  <Card title="Better Auth" icon="shield" href="/developer-resources/better-auth-adaptor">
    Create a customer when a user signs up, and add checkout and the customer portal to your auth flow.
  </Card>

  <Card title="Supabase" icon="database" href="/developer-resources/supabase-boilerplate">
    Next.js and Supabase starter with auth, database schema, webhooks, and a pricing page.
  </Card>

  <Card title="Convex" icon="database" href="/developer-resources/convex-component">
    Checkout, customer portal, and webhook functions for your Convex backend.
  </Card>
</CardGroup>

<AccordionGroup>
  <Accordion title="All Other Framework Adaptors">
    <CardGroup cols={4}>
      <Card title="SvelteKit" icon="js" href="/developer-resources/sveltekit-adaptor" />

      <Card title="Nuxt" icon="vuejs" href="/developer-resources/nuxt-adaptor" />

      <Card title="Remix" icon="react" href="/developer-resources/remix-adaptor" />

      <Card title="Express" icon="js" href="/developer-resources/express-adaptor" />

      <Card title="Fastify" icon="bolt" href="/developer-resources/fastify-adaptor" />

      <Card title="Hono" icon="cloud" href="/developer-resources/hono-adaptor" />

      <Card title="Astro" icon="star" href="/developer-resources/astro-adaptor" />

      <Card title="TanStack" icon="chart-line" href="/developer-resources/tanstack-adaptor" />

      <Card title="Bun" icon="bread-slice" href="/developer-resources/bun-adaptor" />
    </CardGroup>
  </Accordion>
</AccordionGroup>

## Migration from Node.js SDK

<Info>
  The TypeScript SDK replaces the legacy Node.js SDK. If you use the Node.js SDK, see the [migration guide](https://github.com/dodopayments/dodopayments-typescript/blob/main/MIGRATION.md) to update your integration.
</Info>

## Get Help

* **Discord**: Join our [community server](https://discord.gg/bYqAp4ayYh) for real-time help.
* **Email**: Contact us at [support@dodopayments.com](mailto:support@dodopayments.com).
* **GitHub**: Open an issue on the respective SDK repository.
* **Documentation**: Visit the [API reference](/api-reference/introduction).

## Contributing

Each SDK repository accepts contributions. Most have a `CONTRIBUTING.md` file with guidelines for reporting bugs, requesting features, submitting pull requests, running tests, and code style conventions.

Visit the individual SDK pages to access their GitHub repositories and contribution guidelines.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.