Quickstart
Install the SDK, create a flag and check it in your code, in about two minutes.
Install the SDK
npm i @plinth/sdk
Initialise the client
Create one client when your app starts. The server key stays on your server; browsers use the client key.
import { createClient } from '@plinth/sdk';
export const plinth = createClient({
key: process.env.PLINTH_SERVER_KEY,
});
Check a flag
const on = await plinth.isEnabled('checkout-v2', { user });
if (on) renderNewCheckout();
else renderCheckout();
The second argument is the context: who is asking. Rules match against it, so include the attributes you want to target on, such as plan or country.
Next steps
- Create a flag in the dashboard
- Roll it out gradually
Stuck? Email support@plinth.example