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
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.
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.
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.
Protocol Fragmentation
Organizations requiring both real-time streaming and batch analytics need separate client implementations. Teams maintain parallel codebases for the same logical operations.
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.
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.
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.
Error Handling Inconsistency
Custom error handling across teams leads to inconsistent error propagation, missing retry logic, and silent failures in production.
No Rate Limit Awareness
Without SDK support, rate limit detection is manual. 429 responses cause cascading failures that could be prevented with proactive throttling.
Version Drift
Custom clients built for one API version break when the API evolves. Versioned SDKs maintain compatibility across minor updates.
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.
Get Started in Four Languages
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.
JavaScript SDK
npm install @perception/x2-sdk. Browser and Node.js compatibility. Event-driven architecture. WebSocket support built-in. TypeScript declarations included.
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.
Rust SDK
Cargo.toml: perception-x2 = 2.0. Async traits with error type composition. Composable error handling. Type-safe throughout. Rust 1.70+ required.
SDK Capabilities Built Into Every Library
Automatic OAuth 2.0
Complete token lifecycle — acquisition, caching, refresh before expiry, coordinated refresh during concurrent requests.
Client-Side Rate Limiting
Track rate limit headers and throttle requests before exceeding server limits. Automatic 429 handling with Retry-After support.
Exponential Backoff
Transient failures trigger automatic retries with exponential backoff and randomized jitter. Configurable per request or globally.
Structured Error Handling
Typed errors mapping to specific failure modes. Error types carry request IDs for debugging and log correlation.
WebSocket Reconnection
Automatic heartbeat monitoring and reconnection with event replay. Resume from last received event ID on transient disconnections.
Request/Response Logging
Debug modes log all API requests and responses. Production modes log only errors and rate limit events.
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.
JavaScript Dashboards
Build real-time dashboards with WebSocket subscriptions. TypeScript declarations provide complete type safety.
Go Microservices
Build high-throughput backend services with goroutine-safe clients. Context propagation throughout request lifecycle.
Rust Systems
Build performant systems with type-safe error handling. Async traits with composable error types throughout.
Mobile Applications
Integrate Perception X2 into mobile applications with lightweight SDK initialization and background data fetching.
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.
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.
Language-Native Idioms
Python async/await, JavaScript Promises, Go channels, Rust async traits. Developers work with familiar patterns, not foreign abstractions.
Full Protocol Coverage
REST, WebSocket, and gRPC from a single client. SDKs handle protocol selection automatically based on the operation.
Comprehensive Error Handling
Typed errors mapping to specific failure modes. Error types carry request IDs for debugging and log correlation.
Automatic Resilience
Rate limit detection, exponential backoff, jitter-aware retry, and circuit breaker patterns. Transient failures resolve automatically.
WebSocket Reconnection
Automatic heartbeat monitoring and reconnection with event replay. Resume from last received event ID on transient disconnections.
Production Maintained
Same engineering team that builds the API. Versioned in lockstep. Backward compatibility guaranteed.
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.
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.
SDK — Common Developer Questions
Which programming languages are supported?
How do I install the SDK?
What protocols does the SDK support?
How does authentication work in the SDK?
What is the minimum runtime version?
How does the SDK handle rate limits?
Does the SDK support WebSocket reconnection?
Can I use the SDKs in commercial products?
SDK — What Developers Ask
What is the best SDK for Python?
How do I get the latest SDK version?
Are there SDKs for mobile platforms?
How do I report a bug in the SDK?
Can I use the SDKs with the sandbox environment?
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.