Klor.

Overview

Klor serves remote config, feature flags, and mobile update gating to React and React Native. Install one package, paste a key, and change what your app does without shipping a build.

How it fits together

You edit flags in the dashboard. Nothing reaches your apps until you publish, which compiles the environment into an immutable JSON snapshot and pushes it to Cloudflare’s edge. Your app downloads that snapshot and evaluates flags locally.

That last part matters more than it sounds. Because evaluation happens on the device, a flag read is a synchronous function call, no request, no loading state, and no user context ever leaves the device.

Quickstart

Install the package:

pnpm add @klor/react

Create a project in the dashboard, open API keys, and make a public key. It is shown once.

app.tsx
import { KlorProvider, createKlorClient } from '@klor/react'

const klor = createKlorClient({ apiKey: 'klor_pub_…' })

export function App() {
return (
<KlorProvider client={klor} context={{ userId: user.id }}>
<Routes />
</KlorProvider>
)
}

Then read a flag anywhere below the provider:

checkout.tsx
import { useFlag } from '@klor/react'

function Checkout() {
const newCheckout = useFlag('checkout_v2', false)
return newCheckout ? <OneTapCheckout /> : <CardForm />
}

The second argument is the value you get when Klor has nothing useful to say, before the first snapshot arrives, if the key does not exist, or if its type does not match. Choose it as the behaviour you want when Klor is not there at all.

Publish to go live

Editing a flag stages the change. The dashboard keeps an unpublished changes banner in view until you publish, because the most common way to be confused by a config service is to change something and not notice it never shipped.

Two kinds of key

A klor_pub_ key is meant to ship inside your app. Anything readable with it should be treated as public: a key in a mobile binary can be extracted. Flags marked sensitive are stripped from the payload a public key receives.

A klor_sec_ key stays on a server and sees everything, including sensitive flags. Never ship one to a client.