Official Client Libraries for Every Integration

SDK & Libraries. Engineered for Enterprise Integration.

Perception X2 ships official SDKs for Python, JavaScript, Go, and Rust — purpose-built client libraries that handle authentication, protocol negotiation, rate limiting, and error recovery so your team ships integrations in days, not weeks.

4 Languages · REST / WebSocket / gRPC · Type-Safe · Production Ready

Python, JavaScript, Go, Rust
Automatic Authentication
Type-Safe Interfaces
Full Protocol Coverage
Client Libraries Engineered for Enterprise Integration

Four Official SDKs, One Consistent API Surface

The Perception X2 SDK suite provides official client libraries for four programming languages — Python, JavaScript/TypeScript, Go, and Rust — delivering programmatic access to narrative deployment, sentiment intelligence, crisis response, and real-time analytics.

Each SDK is maintained by the same engineering team that builds the Perception X2 platform. Language-native idioms, comprehensive type definitions, and consistent API surfaces across all four SDKs ensure your team can work in the language that matches your infrastructure — without sacrificing capability or reliability.

The SDK architecture abstracts away the complexity of multi-protocol integration. Automatic OAuth 2.0 token lifecycle management, client-side rate limiting with intelligent throttling, exponential backoff retries, and structured error handling are built into every library. Developers interact with Perception X2 through clean, documented interfaces rather than raw HTTP calls.

SDK features include automatic protocol selection, type-safe interfaces, structured error handling, WebSocket reconnection with event replay, request/response logging, and comprehensive error recovery. Every SDK ships with full protocol coverage across REST, WebSocket, and gRPC.

4
Languages
3
Protocols
100%
API Coverage
Type
Safe
Auto
Retry Logic
Integration Complexity

Why Custom HTTP Clients Fail at Scale

Without official SDKs, teams build bespoke HTTP clients for every integration. Authentication flows, request signing, response parsing, and error handling become custom engineering projects.

01

Manual HTTP Client Construction

Without official SDKs, development teams build bespoke HTTP clients. Authentication flows, request signing, response parsing, and error handling become custom engineering projects.

02

Protocol Fragmentation

Organizations requiring both real-time streaming and batch analytics need separate client implementations. Teams maintain parallel codebases for the same logical operations.

03

Authentication Lifecycle

OAuth 2.0 token acquisition, refresh, and rotation are deceptively complex. Token expiry handling and concurrent request coordination are error-prone when implemented from scratch.

04

Type Safety Gaps

Raw HTTP responses lack compile-time type checking. API field changes, optional fields, and nested object structures introduce runtime errors that static typing would catch.

05

SDK Maintenance Burden

Community-maintained libraries drift out of sync with API changes. Deprecated fields persist, new endpoints go unimplemented, breaking changes cascade through dependencies.

06

Error Handling Inconsistency

Custom error handling across teams leads to inconsistent error propagation, missing retry logic, and silent failures in production.

07

No Rate Limit Awareness

Without SDK support, rate limit detection is manual. 429 responses cause cascading failures that could be prevented with proactive throttling.

08

Version Drift

Custom clients built for one API version break when the API evolves. Versioned SDKs maintain compatibility across minor updates.

The SDK Suite

Four Official SDKs, One Consistent API Surface

Perception X2 solves integration complexity through official client libraries for Python, JavaScript/TypeScript, Go, and Rust — each engineered to handle authentication, protocol management, rate limiting, and error recovery automatically.

Unified API Surface

All four SDKs expose identical API structures — same method names, parameter conventions, and response shapes. Teams working across multiple languages encounter zero API-level differences.

Automatic Protocol Selection

Each SDK connects to the appropriate protocol based on the operation — REST, WebSocket, or gRPC. Developers do not select protocols manually; the SDK routes each call to the optimal transport.

Built-In Authentication

OAuth 2.0 token acquisition, caching, refresh, and rotation are fully abstracted. SDKs manage token lifecycle transparently — including concurrent refresh coordination.

Type-Safe Interfaces

Every SDK provides comprehensive type definitions — Python type hints with Pydantic models, TypeScript declarations, Go structs, and Rust traits. API responses arrive as typed objects.

Installation

Get Started in Four Languages

01
Step 01

Python SDK

pip install perception-x2. Async-first architecture built on httpx. Type hints and Pydantic models ensure IDE autocompletion and runtime validation. Python 3.10+ required.

02
Step 02

JavaScript SDK

npm install @perception/x2-sdk. Browser and Node.js compatibility. Event-driven architecture. WebSocket support built-in. TypeScript declarations included.

03
Step 03

Go SDK

go get github.com/perception/x2-go. Performant, goroutine-safe client. Context-aware methods, structured error types, and connection pooling. Go 1.21+ required.

04
Step 04

Rust SDK

Cargo.toml: perception-x2 = 2.0. Async traits with error type composition. Composable error handling. Type-safe throughout. Rust 1.70+ required.

Core Features

SDK Capabilities Built Into Every Library

Feature

Automatic OAuth 2.0

Complete token lifecycle — acquisition, caching, refresh before expiry, coordinated refresh during concurrent requests.

Feature

Client-Side Rate Limiting

Track rate limit headers and throttle requests before exceeding server limits. Automatic 429 handling with Retry-After support.

Feature

Exponential Backoff

Transient failures trigger automatic retries with exponential backoff and randomized jitter. Configurable per request or globally.

Feature

Structured Error Handling

Typed errors mapping to specific failure modes. Error types carry request IDs for debugging and log correlation.

Feature

WebSocket Reconnection

Automatic heartbeat monitoring and reconnection with event replay. Resume from last received event ID on transient disconnections.

Feature

Request/Response Logging

Debug modes log all API requests and responses. Production modes log only errors and rate limit events.

Use Cases

What Developers Build With the SDKs

Python Data Pipelines

Build sentiment monitoring and analytics pipelines with async/await patterns. Pydantic models ensure type safety throughout.

Python

JavaScript Dashboards

Build real-time dashboards with WebSocket subscriptions. TypeScript declarations provide complete type safety.

JS/TS

Go Microservices

Build high-throughput backend services with goroutine-safe clients. Context propagation throughout request lifecycle.

Go

Rust Systems

Build performant systems with type-safe error handling. Async traits with composable error types throughout.

Rust

Mobile Applications

Integrate Perception X2 into mobile applications with lightweight SDK initialization and background data fetching.

Mobile
Benefits

Why Use the Official SDKs

Faster Integration

Official SDKs eliminate weeks of custom development. Idiomatic patterns per language. Typed models and automatic retry.

Automatic Authentication

OAuth 2.0 token lifecycle fully managed. Concurrent refresh coordination. No application-level authentication code.

Built-In Resilience

Rate limit detection, exponential backoff, jitter-aware retry, and circuit breaker patterns. Transient failures resolve automatically.

Type Safety

Python type hints, TypeScript declarations, Go structs, Rust traits. API responses arrive as typed objects, not raw dictionaries.

Multi-Protocol

REST, WebSocket, and gRPC from a single client. SDKs handle protocol selection automatically.

Production Ready

Maintained by the same engineering team that builds the API. Versioned in lockstep. Backward compatibility guaranteed.

Why Official SDKs

What Makes the Perception X2 SDKs Different

The SDKs are not wrappers. They are purpose-built client libraries maintained by the same engineering team that builds the platform. Native idioms per language, comprehensive error handling, automatic resilience.

01

Language-Native Idioms

Python async/await, JavaScript Promises, Go channels, Rust async traits. Developers work with familiar patterns, not foreign abstractions.

02

Full Protocol Coverage

REST, WebSocket, and gRPC from a single client. SDKs handle protocol selection automatically based on the operation.

03

Comprehensive Error Handling

Typed errors mapping to specific failure modes. Error types carry request IDs for debugging and log correlation.

04

Automatic Resilience

Rate limit detection, exponential backoff, jitter-aware retry, and circuit breaker patterns. Transient failures resolve automatically.

05

WebSocket Reconnection

Automatic heartbeat monitoring and reconnection with event replay. Resume from last received event ID on transient disconnections.

06

Production Maintained

Same engineering team that builds the API. Versioned in lockstep. Backward compatibility guaranteed.

Who Uses These SDKs

Developers Building on Perception X2

Python Developers

Data pipelines, automation workflows, async integrations. Pydantic models and type hints throughout.

JavaScript Developers

Web applications, Node.js backends, real-time dashboards. Full TypeScript support.

Go Developers

High-throughput backend services, microservices, performance-critical integrations.

Rust Developers

Systems programming, performance-critical applications, type-safe error composition.

Full-Stack Teams

End-to-end integration with consistent API surfaces across languages. Frontend and backend teams share the same patterns.

Platform Engineers

Building internal platforms, automation tooling, infrastructure integrations.

Why Perception X2

The Platform Behind the SDKs

15+ Years of Operational Excellence

Every SDK refined through thousands of real-world deployments across the world's most demanding environments.

300+ Elite Client Integrations

Trusted by governments, global enterprises, and institutions. Each engagement contributes to SDK refinement.

Zero Security Incidents

Your most sensitive data protected by military-grade security. Zero incidents in 15+ years.

99.9999% Uptime SLA

Tier-based rate limits, automatic retry, and circuit breaker patterns. Operational concerns covered.

Multi-Language SDK Coverage

Python, JavaScript, Go, and Rust. Same API surface across all official SDKs.

Production-Ready Patterns

Every SDK demonstrates production patterns. Code that ships, not code that demos.

Frequently Asked Questions

SDK — Common Developer Questions

Which programming languages are supported?
Perception X2 provides official SDKs for Python, JavaScript/TypeScript, Go, and Rust. Each SDK covers REST, WebSocket, and gRPC protocols with full type safety.
How do I install the SDK?
Install via standard package managers: pip install perception-x2 (Python), npm install @perception/x2-sdk (JavaScript), go get github.com/perception/x2-go (Go), or add to Cargo.toml (Rust).
What protocols does the SDK support?
Each SDK supports REST, WebSocket, and gRPC. The Python and JavaScript SDKs provide full coverage. Go SDK covers REST and gRPC. Rust SDK covers all three.
How does authentication work in the SDK?
SDKs handle the complete OAuth 2.0 lifecycle automatically — token acquisition, caching, refresh before expiry, and coordinated refresh during concurrent requests. Tokens are never exposed to application code.
What is the minimum runtime version?
Python 3.10+, Node.js 18+, Go 1.21+, Rust 1.70+. All SDKs follow semantic versioning aligned with the API version.
How does the SDK handle rate limits?
SDKs track rate limit headers and throttle requests before exceeding server limits. When a 429 response is received, the SDK pauses requests until the window resets.
Does the SDK support WebSocket reconnection?
Yes. WebSocket connections include automatic heartbeat monitoring and reconnection with event replay. The SDK reconnects using the last received event ID.
Can I use the SDKs in commercial products?
Yes. Official SDKs are provided under a permissive license. Use them as starting points, modify them for your needs, and ship to production.
People Also Ask

SDK — What Developers Ask

What is the best SDK for Python?
The Perception X2 Python SDK is the recommended choice for Python integrations. It provides async-first architecture, type hints, and Pydantic models for type safety.
How do I get the latest SDK version?
Install via standard package managers. The latest version is 2.4.x for Python, JavaScript, and Go. Rust follows a monthly release cadence.
Are there SDKs for mobile platforms?
Yes. The JavaScript SDK works with React Native for mobile development. Native Swift and Kotlin SDKs are in beta.
How do I report a bug in the SDK?
Report bugs through the Developer Portal or GitHub Issues. The engineering team triages issues and releases fixes in biweekly cycles.
Can I use the SDKs with the sandbox environment?
Yes. SDKs support both production and sandbox environments. Configure the base URL and credentials to switch between environments.
Get Started

Install the Perception X2 SDK

Get started in 5 minutes with the official SDK for your preferred language. Authentication, rate limiting, and error recovery are handled automatically.

Install via standard package managers — pip, npm, go get, or cargo.

All SDKs support both production and sandbox environments.

4 Languages
REST/WebSocket/gRPC
Type-Safe
Auto Retry
Production Ready