First steps
Your first remote config
Define a typed config value in the dashboard, fetch it from any SDK with cohort targeting, and roll forward or back without an app release.
Sankofa Remote Config (a.k.a. Config) gives you typed, versioned, cohort-targetable values you can change without redeploying your app. It shares the same decision-handshake plumbing as Switch, so reads are local and free after the first call.
Use it for: feature toggles that need richer-than-boolean values, hardcoded magic numbers (timeouts, retry caps, thresholds), copy that needs to ship faster than your release cadence, or lightweight A/B parameter tuning that doesn't warrant a full experiment.
1. Create a config item
Open Config → Items
From the project nav, Config → Items, click New item.
Name the key in snake_case
Examples:
max_upload_mb,support_email,home_hero_copy,retry_backoff_ms.Pick a type
Sankofa supports
string,int,float,bool, andjson. Once published, the type is immutable — pick carefully.Set a default value
The default is what every user sees until you ship a cohort-specific override. For our example pick
intwith default25.
2. Fetch from your SDK
Reads are typed at the call site — pass the expected return type and a fallback. The fallback runs whenever the engine is unreachable, the snapshot is empty, or a key is missing.
import { Sankofa } from "@sankofa/browser";
import { configPlugin, getConfig } from "@sankofa/config";
await Sankofa.init({
apiKey: process.env.NEXT_PUBLIC_SANKOFA_KEY!,
endpoint: "https://api.sankofa.dev",
plugins: [configPlugin()],
});
const config = getConfig()!;
const maxMB = config.getNumber("max_upload_mb", 25);import 'package:sankofa_flutter/sankofa_flutter.dart';
final config = SankofaConfig(defaults: {'max_upload_mb': 25});
await Sankofa.instance.init(
apiKey: 'sk_live_...',
endpoint: 'https://api.sankofa.dev',
);
final maxMB = config.get<int>('max_upload_mb', 25);import { Sankofa, SankofaConfig } from "@sankofa/react-native";
const config = new SankofaConfig({ defaults: { max_upload_mb: 25 } });
Sankofa.initialize("sk_live_...", {
endpoint: "https://api.sankofa.dev",
});
const maxMB = config.get<number>("max_upload_mb", 25);import Sankofa
Sankofa.shared.initialize(
apiKey: "sk_live_...",
config: SankofaConfig(endpoint: "https://api.sankofa.dev")
)
_ = SankofaRemoteConfig.shared.withDefaults(["max_upload_mb": 25])
let maxMB: Int = SankofaRemoteConfig.shared.get("max_upload_mb", default: 25)import dev.sankofa.sdk.Sankofa
import dev.sankofa.sdk.remoteconfig.SankofaRemoteConfig
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
Sankofa.init(this, "sk_live_...", SankofaConfig())
SankofaRemoteConfig.init(this, mapOf("max_upload_mb" to 25))
}
}
val maxMB: Int = SankofaRemoteConfig.get("max_upload_mb", 25)import { Sankofa } from "@sankofa/node";
const maxMB = await Sankofa.config.getNumber("max_upload_mb", {
distinctId: req.user?.id ?? "anon",
defaultValue: 25,
});maxMB, err := client.Config.GetInt(ctx, "max_upload_mb", sankofa.ConfigOptions{
DistinctID: userID,
DefaultValue: 25,
})max_mb = sankofa.config.get_int(
"max_upload_mb",
distinct_id=request.user.id,
default_value=25,
)int maxMB = Sankofa.config().getInt("max_upload_mb",
ConfigOptions.builder()
.distinctId(user.getId())
.defaultValue(25)
.build());3. Ship a cohort-specific override
Open the item in the dashboard and click Add override.
Pick a cohort
For example,
Pro plan customers(cohorts are defined under People → Cohorts).Set the override value
For Pro customers, raise
max_upload_mbto200.Publish
Within ≤ 30 seconds (next handshake) Pro users see
200; everyone else stays on the default25. No code change, no app release.
4. Version, audit, and roll back
Every publish creates an immutable version with the actor, timestamp, and full diff captured.
- History — open Config → Items → <your item> → History to see every change.
- Diff — click any two versions to see what overrides changed.
- Roll back — click Restore on a previous version. The next handshake reverts users to that payload.
- Schedule — schedule a value to take effect at a specific UTC timestamp (Pro tier and above).
When to use Config vs. Switch
| You need… | Use |
|---|---|
| an on/off toggle | Switch |
| a numeric, string, or JSON value | Config |
| an A/B variant with stat-sig metrics | Switch variants or Config A/B experiments |
| a value that depends on a cohort, but should never enable a new code path | Config |
| a value that gates a code path | Switch |
Both share the same decision handshake, so using both costs the same as using one.