Voltar pro gateway Throne Gateway
SDKs · LIB OFICIAL

SDKs oficiais
+ community

Integre Throne em 1 linha. Idempotência, retry exponencial e webhook signature verification embutidos · você só foca no negócio.

7
Linguagens
suportadas
2
SDKs
oficiais
5
Em desenvolvimento
Q3/Q4 2026
Community
welcome

SDKs oficiais

Mantidos pelo time core. Testes E2E rodam em CI · atualização sincronizada com release da API. Recomendados pra produção.

PHP
OFICIAL · v1.0
$ composer require throne/sdk-php
  • Laravel ServiceProvider auto-discovery
  • Idempotency-Key automático (UUID v4)
  • Retry exponencial (5 tentativas)
  • Webhook signature verifier built-in
  • PHP 8.2+ · type hints completos
Node.js
OFICIAL · v1.0
$ npm install @throne/sdk
  • TypeScript types completos · zero any
  • Async/await · zero Promise chains
  • Webhook handler Express/Fastify ready
  • ESM + CJS dual export
  • Node 18+ · sem polyfills
Python
Q3 2026 · BETA
$ pip install throne-sdk
  • Type hints (PEP 484) + Pydantic models
  • FastAPI middleware · Django middleware
  • asyncio + httpx ou requests sync
  • Webhook handler decorator-based
  • Python 3.11+
Go
Q4 2026 · ALPHA
$ go get github.com/throne-gateway/sdk-go
  • Context-aware (cancellation + timeout)
  • Zero deps externas
  • net/http handler middleware webhook
  • Go 1.22+ · generics em response models
  • 100% backward-compatible breaking change policy
Ruby
Q4 2026 · ROADMAP
$ gem install throne-sdk
  • Rails Engine + ActiveJob webhook
  • Sorbet types (RBS files)
  • Ruby 3.2+
  • OmniAuth strategy oficial Throne (futuro)
Java
Q1 2027 · PLANNED
$ implementation 'com.throne:sdk:1.0'
  • Spring Boot starter + auto-config
  • Java 17+ · sealed classes + records
  • Reactive (WebFlux) + sync support
  • Maven Central + Gradle
  • Native image (GraalVM) ready
.NET
COMMUNITY
$ dotnet add package Throne.SDK
  • Mantido pela community · não-oficial
  • .NET 8+ · async/await
  • Nullable reference types
  • ASP.NET middleware webhook
Postman
COLLECTION
$ Importar de https://api.thronecorporate.com/docs/postman
  • Coleção 2.1.0 atualizada da spec OpenAPI
  • Pre-request scripts (Idempotency-Key auto)
  • Environment vars: pk_test, sk_test
  • Tests assertion (status 201, signature válida)

Comparação de features

O que cada SDK oferece. Use pra decidir qual stack adotar.

Feature PHP Node.js Python Go Ruby Java
Idempotency-Key automático
Retry exponencial built-in
Webhook signature verifier
Type-safety
Framework integration LaravelExpress/FastifyFastAPI/Django net/httpRailsSpring Boot
Async support N/Aasync/awaitasyncio contextsyncCompletableFuture
Status ProductionProductionBeta AlphaRoadmapPlanned

Exemplo · PHP SDK

Criar transação PIX, escutar webhook e processar paid → 25 linhas.

vendor/throne/sdk-php · uso típico PHP 8.2+
use Throne\SDK\ThroneClient;
use Throne\SDK\Webhooks\Verifier;

// Init · pk_live/sk_live ou pk_test/sk_test do env
$throne = new ThroneClient(env('THRONE_PK'), env('THRONE_SK'));

// Criar cobrança PIX · idempotency automático
$tx = $throne->transactions->create([
    'amount_cents' => 9900,
    'payment_method' => 'pix',
    'customer' => ['email' => 'cliente@example.com'],
    'metadata' => ['order_id' => 'PED-42'],
]);
echo $tx->payment_data->qr_code_payload;

// Handler webhook · assinatura verificada antes de processar
Route::post('/throne/webhook', function (Request $req) use ($throne) {
    $event = Verifier::verify(
        payload: $req->getContent(),
        signature: $req->header('X-Throne-Signature'),
        secret: env('THRONE_WEBHOOK_SECRET'),
    );

    if ($event->type === 'transaction.paid') {
        Order::where('id', $event->data->metadata->order_id)->update(['paid' => true]);
    }

    return response('OK', 200);
});

Exemplo · Node.js SDK

Mesma transação acima · com TypeScript types completos.

@throne/sdk · TypeScript Node 18+
import { ThroneClient, verifyWebhook } from '@throne/sdk';
import express from 'express';

const throne = new ThroneClient({
  publicKey: process.env.THRONE_PK!,
  secretKey: process.env.THRONE_SK!,
});

const app = express();
app.use(express.raw({ type: 'application/json' }));

// Criar cobrança PIX
app.post('/checkout', async (req, res) => {
  const tx = await throne.transactions.create({
    amount_cents: 9900,
    payment_method: 'pix',
    customer: { email: 'cliente@example.com' },
    metadata: { order_id: 'PED-42' },
  });
  res.json({ qr: tx.payment_data.qr_code_payload });
});

// Webhook handler
app.post('/throne/webhook', (req, res) => {
  const event = verifyWebhook({
    payload: req.body,
    signature: req.headers['x-throne-signature'] as string,
    secret: process.env.THRONE_WEBHOOK_SECRET!,
  });

  if (event.type === 'transaction.paid') {
    // Type-safe: event.data tem shape WebhookTransactionPaid
    db.orders.update({ id: event.data.metadata.order_id }, { paid: true });
  }

  res.status(200).send('OK');
});

Exemplo · Python SDK (beta)

Pydantic models · type hints · FastAPI integrado.

throne-sdk · Pydantic + FastAPI Python 3.11+ · BETA
from throne_sdk import ThroneClient, verify_webhook
from fastapi import FastAPI, Request, HTTPException
import os

throne = ThroneClient(
    public_key=os.environ['THRONE_PK'],
    secret_key=os.environ['THRONE_SK'],
)

app = FastAPI()

@app.post('/checkout')
async def checkout():
    tx = await throne.transactions.create(
        amount_cents=9900,
        payment_method='pix',
        customer={'email': 'cliente@example.com'},
        metadata={'order_id': 'PED-42'},
    )
    return {'qr': tx.payment_data.qr_code_payload}

@app.post('/throne/webhook')
async def webhook(req: Request):
    payload = await req.body()
    try:
        event = verify_webhook(
            payload=payload,
            signature=req.headers.get('X-Throne-Signature'),
            secret=os.environ['THRONE_WEBHOOK_SECRET'],
        )
    except ValueError:
        raise HTTPException(401, 'invalid_signature')

    if event.type == 'transaction.paid':
        # Pydantic model: event.data tipado
        order_id = event.data.metadata['order_id']
        await mark_paid(order_id)

    return {'ok': True}

Sem SDK pra sua stack?

Use HTTP direto · 7 langs de exemplo no quickstart. Ou contribua: PRs welcome no monorepo SDKs.

→ Quickstart PIX (7 langs) → API Reference (Scalar playground) → Github org

Pronto pra integrar?

Gere sua API key e teste o sandbox em 60 segundos.

Começar agora →