SDK Integration Guide
Deep dive into Savvagent SDKs. Learn about integration, configuration options, and best practices for all supported platforms.
π¦ Official SDK Repository
All Savvagent SDKs, integrations, and examples are maintained in the dedicated SDK repository:
github.com/savvagent/savvagent-sdksAvailable SDKs
Core Client SDK
π¨ @savvagent/sdk
Core TypeScript/JavaScript SDK with real-time WebSocket updates, caching, and type-safe API
Framework SDKs (Beta)
βοΈ @savvagent/react
React hooks integration
π© @savvagent/vue
Vue 3 composables
π· @savvagent/solid
SolidJS primitives
π§ @savvagent/svelte
Svelte stores
β² @savvagent/nextjs
Next.js App & Pages Router support
πΏ @savvagent/remix
Remix loaders & actions integration
π§ @savvagent/sveltekit
SvelteKit server-side integration
π @savvagent/astro
Astro framework integration
Mobile SDKs (Beta)
π SavvagentSDK (iOS)
Native Swift with async/await, SwiftUI/UIKit support
π€ savvagent-android-sdk
Native Kotlin with Jetpack Compose, Flow-based updates
Server SDKs (Beta)
π’ @savvagent/node-server
Node.js with Express, Fastify, NestJS compatibility
β savvagent-java-server-sdk
Java 11+ with Maven/Gradle support
πΉ savvagent-go-server-sdk
Go 1.21+ with idiomatic patterns
π¦ savvagent (Rust)
Rust 1.70+ with Tokio async runtime
MCP Integrations (Beta)
π @savvagent/mcp-sdk
Base SDK for Model Context Protocol integrations
π @savvagent/mcp-sentry
Sentry error tracking integration
Quick Start
Installation
# Core SDK
npm install @savvagent/sdk
# Framework-specific (choose one)
npm install @savvagent/react
npm install @savvagent/vue
npm install @savvagent/nextjs
npm install @savvagent/svelteBasic Usage
import { SavvagentClient } from '@savvagent/sdk';
const client = new SavvagentClient({
apiKey: 'sdk_prod_...',
apiUrl: 'https://api.savvagent.com'
});
// Evaluate a flag
const result = await client.evaluateFlag('new-checkout', {
user_id: 'user-123',
attributes: {
plan: 'premium'
}
});
if (result.enabled) {
// Show new checkout
}π‘ Complete SDK Documentation
For complete SDK documentation, framework integration guides, and working examples, visit the official SDK repository.
Framework Examples
The SDK repository includes complete working examples for popular frameworks:
βοΈ React
React with hooks and context
β² Next.js
Next.js App Router integration
π© Vue 3
Vue 3 Composition API
π§ Svelte
SvelteKit integration
π’ Node.js
Backend server integration
π iOS
Native Swift integration
π€ Android
Native Kotlin integration
Key Features
β‘ Sub-1ms Evaluation
Flag evaluation happens entirely in-memory after initialization for maximum performance.
π Real-time Updates
SDKs automatically connect via WebSocket/SSE for instant flag updates without polling.
π Automatic Telemetry
Events are batched and sent automatically for analytics and AI error detection.
πΎ Smart Caching
Flags are cached locally with configurable TTL to minimize API calls and maximize performance.
π― Sticky Targeting
Consistent hashing ensures users always see the same flag state for percentage rollouts.
π‘οΈ Graceful Degradation
SDKs fail gracefully with safe defaults if the API is unreachable or a flag doesn't exist.
π TypeScript First
Full TypeScript support with comprehensive type definitions out of the box.
π Multi-Platform
SDKs for web, mobile (iOS/Android), and server environments (Node.js, Java, Go, Rust).
API Reference
For detailed information about the API endpoints that SDKs interact with, see the API documentation:
π Flag Consumer API
Complete REST API documentation for evaluation, telemetry, analytics, and audit endpoints.
π Complete API Docs
Comprehensive API reference with all request/response examples and evaluation logic details.
Best Practices
new-payment-flow.Support & Resources
Getting Help
- SDK Documentation: GitHub Repository
- API Documentation: Flag Consumer API Reference
- Issues & Bugs: Report on GitHub
- Email Support: support@savvagent.com
π Ready to Integrate?
Head over to the SDK repository to get started with comprehensive documentation, working examples, and framework-specific integration guides.