Developers
The developer side, kept short.
Install a library, check a flag, ship. Flags are answered by servers close to your users, and the people you work with change them in plain sentences, without a deploy.
Install
Node
npm install @latch/nodeBrowsers and React
npm install @latch/reactElixir
{:latch_ex, ...} in mix.exsAny language with OpenFeature
Use the OFREP provideriPhone
Swift packageSoonAndroid
Kotlin librarySoonOne screen of code
Sign who the customer is on your server. Read the flag in React.
The browser only gets answers for the flags you mark as visible to apps, never your rules, and it can't pretend to be another customer.
import { Latch } from "@latch/node"; const latch = new Latch(process.env.LATCH_SERVER_KEY); // Sign who this customer is (valid up to 24 hours) app.get("/latch-context", requireLogin, (req, res) => { res.json({ signedContext: latch.signContext({ key: req.user.customerId, country: req.user.country, }), }); });
import { LatchProvider, useFlag } from "@latch/react"; export function App({ signedContext }) { return ( <LatchProvider clientKey="cli-production-..." signedContext={signedContext}> <Checkout /> LatchProvider> ); } function Checkout() { const oneTap = useFlag("one-tap-checkout", false); return oneTap ? <OneTapButton /> : <CardForm />; }
How answers are served
Close to your users, and current.
At the edgeFlag checks are answered on servers near your users, not from one region.
Within 2 secondsA change in Latch reaches connected apps over a live connection, with polling as the fallback.
In memoryServer libraries keep the rules locally, so a check doesn't make a network call.
OpenFeature
Already on OpenFeature?
Point the standard OFREP provider at Latch. No Latch library needed, in any language OpenFeature supports.
POST https://edge.latch.dev/ofrep/v1/evaluate/flags Authorization: Bearer srv-production-...
Security
What keeps it safe
- Three kinds of keyServer, browser and mobile. Browser and mobile keys see only flags marked visible to apps, and never your rules.
- Signed customer detailsYour server signs who the customer is. Flags that require it stay off for anything unsigned.
- Keys stored hashedWe keep only a hash and show you the last 4 characters. Revoke a key at any time.
- Every change recordedWho changed what and when, with approvals when you turn them on. Turning a flag off never waits.
- Inkress connection, read onlyPlans and subscriptions only. The Inkress key is encrypted at rest and webhooks are verified.
API referenceFlags, groups, changes and keys over a REST API, in the same words as the app.
Open the reference