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-sdks

Available SDKs

Core Client SDK

🟨 @savvagent/sdk

Core TypeScript/JavaScript SDK with real-time WebSocket updates, caching, and type-safe API

npm install @savvagent/sdk
View Documentation β†’

Framework SDKs (Beta)

βš›οΈ @savvagent/react

React hooks integration

npm install @savvagent/react
Beta

🟩 @savvagent/vue

Vue 3 composables

npm install @savvagent/vue
Beta

πŸ”· @savvagent/solid

SolidJS primitives

npm install @savvagent/solid
Beta

🟧 @savvagent/svelte

Svelte stores

npm install @savvagent/svelte
Beta

β–² @savvagent/nextjs

Next.js App & Pages Router support

npm install @savvagent/nextjs
Beta

πŸ’Ώ @savvagent/remix

Remix loaders & actions integration

npm install @savvagent/remix
Beta

🟧 @savvagent/sveltekit

SvelteKit server-side integration

npm install @savvagent/sveltekit
Beta

πŸš€ @savvagent/astro

Astro framework integration

npm install @savvagent/astro
Beta

Mobile SDKs (Beta)

🍎 SavvagentSDK (iOS)

Native Swift with async/await, SwiftUI/UIKit support

Swift Package Manager
Beta iOS 15+
View Documentation β†’

πŸ€– savvagent-android-sdk

Native Kotlin with Jetpack Compose, Flow-based updates

Gradle / Maven
Beta Android 8+
View Documentation β†’

Server SDKs (Beta)

🟒 @savvagent/node-server

Node.js with Express, Fastify, NestJS compatibility

npm install @savvagent/node-server
Beta

β˜• savvagent-java-server-sdk

Java 11+ with Maven/Gradle support

Maven / Gradle
Beta Java 11+

🐹 savvagent-go-server-sdk

Go 1.21+ with idiomatic patterns

go get github.com/savvagent/savvagent-go-server-sdk
Beta Go 1.21+

πŸ¦€ savvagent (Rust)

Rust 1.70+ with Tokio async runtime

cargo add savvagent
Beta Rust 1.70+

MCP Integrations (Beta)

πŸ”Œ @savvagent/mcp-sdk

Base SDK for Model Context Protocol integrations

npm install @savvagent/mcp-sdk
Beta

πŸ› @savvagent/mcp-sentry

Sentry error tracking integration

npm install @savvagent/mcp-sentry
Beta

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/svelte

Basic 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:

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:

Best Practices

βœ“
Initialize Once: Create a single SDK instance and reuse it throughout your application.
βœ“
Use Anonymous IDs: The SDK generates anonymous IDs automatically for sticky flag behavior.
βœ“
Subscribe to Real-time Updates: Always listen for flag updates to ensure your UI reflects the latest state.
βœ“
Use Descriptive Flag Keys: Use kebab-case keys like new-payment-flow.
βœ“
Clean Up Event Listeners: Always remove event listeners in component cleanup to prevent memory leaks.
βœ—
Don't Hardcode SDK Keys: Use environment variables. Never commit SDK keys to version control.

Support & Resources

Getting Help

πŸš€ Ready to Integrate?

Head over to the SDK repository to get started with comprehensive documentation, working examples, and framework-specific integration guides.

We use cookies

We use cookies to improve your experience on our site. Some are essential for the site to work, while others help us understand how you use it. Learn more in our Privacy Policy