DepliteDocumentation
Documentation
Everything you need to integrate Deplite into your application — from install to subscriptions.
Getting Started
Installation
Install the Deplite SDK with your package manager of choice.
bash
npm install depliteQuickstart
Create a client, point it at your program, and read your first flag.
client.ts
ts
import { createDepliteClient } from "deplite"
const client = createDepliteClient({
programId: "...",
admin: "...",
})
const enabled = await client.get("feature_name")Core Concepts
- Feature flags are stored on-chain as Solana program state.
- Each flag lives at a deterministic PDA derived from your program and flag name.
- Apps read flag state directly — no centralized backend in the loop.
- Updates are signed transactions, so every change is verifiable and auditable.
SDK Reference
Client Initialization
Configure the client with your program ID, admin pubkey, and an optional RPC.
ts
createDepliteClient({
programId: "Dep1...", // your deployed program
admin: "9xQe...", // pubkey allowed to flip flags
rpc: "https://api.devnet.solana.com", // optional
})| Option | Type | Description |
|---|---|---|
| programId | string | Your deployed Deplite program address. |
| admin | string | Pubkey allowed to update flag state. |
| rpc | string? | Custom Solana RPC URL. Defaults to devnet. |
Reading State
Read a flag's current value. Returns a boolean.
ts
const enabled = await client.get("feature_name")Subscriptions
Subscribe to a flag and react to changes in real time.
ts
client.subscribe("feature_name", (val) => {
// realtime updates
})Error Handling
- Missing flag → returns
false. - RPC failures fall back to the last known cached value.
- Network errors during subscription auto-retry with exponential backoff.
API
REST Endpoints
Coming soon — a hosted REST gateway for non-Solana clients.
RPC Methods
Coming soon — direct RPC method documentation for advanced integrators.
Need help? Open an issue on GitHub.