Skip to Content
SDKOverview

SDK Overview

@pluma-flags/sdk is the client SDK for evaluating feature flags from a Pluma  self-hosted feature flag server.

It fetches a flag snapshot from the Pluma API and evaluates flags locally — no round-trip per flag check. Supports per-subject targeting via allow/deny lists and deterministic rollout percentages.

Install

npm install @pluma-flags/sdk # or pnpm add @pluma-flags/sdk

Quick start

import { PlumaSnapshotCache } from "@pluma-flags/sdk"; const client = PlumaSnapshotCache.create({ baseUrl: "http://localhost:2137", token: "sdk_your_token_here", // Organisation → API Keys in the Pluma UI ttlMs: 30_000, // optional; defaults to 30_000 ms }); const evaluator = await client.evaluator({ subjectKey: "user-123" }); if (evaluator.isEnabled("my-feature")) { // flag is enabled for this subject }

SDK tokens are scoped to a project and environment. Create them in the Pluma UI under Organisation → API Keys.

What’s next

Last updated on