PlatformXeDocs
Get API Key

Installation

Install the PlatformXe SDK for TypeScript, Python, or Go.

The PlatformXe SDKs provide typed clients for all platform services with built-in retry, timeout, and circuit breaker support.

TypeScript

npm install @caldera/platformxe-sdk
import { PlatformXeClient } from '@caldera/platformxe-sdk';

const px = new PlatformXeClient({
  apiKey: process.env.PLATFORMXE_API_KEY!,
});

// Send an email
await px.sendEmail({
  to: 'user@example.com',
  subject: 'Hello from PlatformXe',
  html: '<h1>Welcome!</h1>',
});

// Verify the key and the environment
const me = await px.whoami.get();

Python

pip install platformxe
from platformxe import PlatformXeClient

client = PlatformXeClient(api_key="pxk_live_your_key_here")

# Send an email
client.messaging.send_email(
    to="user@example.com",
    subject="Hello from PlatformXe",
    html="<h1>Welcome!</h1>",
    from_="Your App <hello@yourapp.com>",
)

# Verify the key and the environment
me = client.whoami.get()

Go

go get github.com/calderaxe/platformxe-go
package main

import px "github.com/calderaxe/platformxe-go"

func main() {
    client := px.NewClient(px.ClientConfig{
        APIKey: "pxk_live_your_key_here",
    })

    // Verify the key and the environment
    me, err := client.Whoami.Get()
    if err != nil {
        panic(err)
    }
    _ = me
}

Environment variables

All SDKs read these environment variables as fallbacks:

VariableRequiredDescription
PLATFORMXE_API_KEYYesYour API key (starts with pxk_live_ or pxk_test_)
PLATFORMXE_BASE_URLNoCustom base URL (defaults to https://api.platformxe.com)

.env

PLATFORMXE_API_KEY=pxk_live_your_api_key_here

Framework integration

Next.js (App Router)

// lib/platformxe.ts
import { PlatformXeClient } from '@caldera/platformxe-sdk';

export const px = new PlatformXeClient({
  apiKey: process.env.PLATFORMXE_API_KEY!,
});
// app/api/send-email/route.ts
import { px } from '@/lib/platformxe';

export async function POST(req: Request) {
  const { to, subject, html } = await req.json();
  const result = await px.sendEmail({ to, subject, html });
  return Response.json(result);
}

Express

import { PlatformXeClient } from '@caldera/platformxe-sdk';

const px = new PlatformXeClient({
  apiKey: process.env.PLATFORMXE_API_KEY!,
});

app.post('/send-email', async (req, res) => {
  const result = await px.sendEmail(req.body);
  res.json(result);
});

Django / Flask

# settings.py or config
from platformxe import PlatformXeClient

px_client = PlatformXeClient(api_key=os.environ["PLATFORMXE_API_KEY"])

Never expose your API key in client-side code. The SDK should only be used in server-side environments (Node.js, Next.js API routes, serverless functions, Django views, Go servers).

Next steps