PlatformXeDocs
Get API Key

Configuration

All SDK configuration options for TypeScript, Python, and Go.

Each SDK accepts the same core configuration options with language-appropriate naming.

TypeScript

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

const px = new PlatformXeClient({
  apiKey: 'pxk_live_your_api_key_here',
  baseUrl: 'https://api.platformxe.com',
  retries: 3,
  timeoutMs: 10000,
  failOpen: false,
});
OptionTypeDefaultDescription
apiKeystring--Required. Your PlatformXe API key
baseUrlstringhttps://api.platformxe.comAPI base URL
retriesnumber3Max retry attempts on transient failures
timeoutMsnumber10000Request timeout in milliseconds
failOpenbooleanfalseReturn error envelope instead of throwing on failure

Python

from platformxe import PlatformXeClient

client = PlatformXeClient(
    api_key="pxk_live_your_api_key_here",
    base_url="https://api.platformxe.com",
    retries=3,
    timeout=10.0,
    fail_open=False,
)
OptionTypeDefaultDescription
api_keystr--Required. Your PlatformXe API key
base_urlstrhttps://api.platformxe.comAPI base URL
retriesint3Max retry attempts on transient failures
timeoutfloat10.0Request timeout in seconds
fail_openboolFalseReturn error dict instead of raising on failure

Go

client := px.NewClient(px.ClientConfig{
    APIKey:   "pxk_live_your_api_key_here",
    BaseURL:  "https://api.platformxe.com",
    Retries:  3,
    Timeout:  10,
    FailOpen: false,
})
OptionTypeDefaultDescription
APIKeystring--Required. Your PlatformXe API key
BaseURLstringhttps://api.platformxe.comAPI base URL
Retriesint3Max retry attempts on transient failures
Timeoutint10Request timeout in seconds
FailOpenboolfalseReturn error value instead of panicking on failure

Common options

apiKey

Your API key, starting with pxk_live_ (production) or pxk_test_ (test). The key is sent as the x-api-key header on every request.

All SDKs also read the PLATFORMXE_API_KEY environment variable as a fallback.

baseUrl

Override the API endpoint. Useful for local development or testing against a staging environment.

// TypeScript
const px = new PlatformXeClient({ apiKey: '...', baseUrl: 'http://localhost:3000' });
# Python
client = PlatformXeClient(api_key="...", base_url="http://localhost:3000")
// Go
client := px.NewClient(px.ClientConfig{APIKey: "...", BaseURL: "http://localhost:3000"})

retries

Number of retry attempts for transient failures (5xx errors, network timeouts). Retries use exponential backoff with jitter.

timeout

Request timeout. If a request takes longer than this, it is aborted and retried (if retries remain).

  • TypeScript: milliseconds (timeoutMs: 5000 for 5 seconds)
  • Python: seconds (timeout=5.0 for 5 seconds)
  • Go: seconds (Timeout: 5 for 5 seconds)

failOpen

When enabled, the SDK returns an error envelope instead of throwing/raising exceptions. This is useful for permission checks where you want to handle failures gracefully.

// TypeScript
const result = await px.permissions.check({ adminId: 'user_xyz', path: 'articles', action: 'read' });
if (!result.success) {
  console.error(result.error.code, result.error.message);
}
# Python
result = client.permissions.check(admin_id="user_xyz", path="articles", action="read")
if not result["success"]:
    print(result["error"]["code"], result["error"]["message"])
// Go
result, err := client.Permissions.Check("user_xyz", "articles", "read")
if err != nil {
    fmt.Println(err)
}

Enable failOpen in production for permission checks. If PlatformXe is unreachable, your application can fall back to a default policy instead of crashing.