Quickstart
Make a flag and read it from a Node.js or Bun server. For browsers, mobile apps or other languages, follow steps 1 to 4, then go to OFREP.
-
Sign in
Go to app.slydog.dev and sign in with GitHub or Google. Slydog makes an organization for you, and you're its owner.
-
Create an app
Choose Create your first app. Give it a name; the key is filled in for you.
Context kinds are what your keys identify. It starts with
user, which is all most apps need. Add others, such ashomeordevice, if you want to target or roll out by them. You can change these later.Every app gets three environments: local, development and production. Production is protected, so changes there ask you to confirm.
-
Create a flag
Open Flags and make a new flag, say
new-checkout, of type Boolean. A boolean flag has two variations,onandoff.The flag starts off in every environment, serving its off variation, so nothing changes for anyone until you turn it on.
-
Make a server key
Open Environments, choose development, and under SDK keys choose + Server key. Copy it: it starts with
sly_srv_and is only shown once. Keep it secret, like a database password.Each environment has its own keys, so the key decides which environment's rules your server reads.
-
Install the provider
npm install @slydogdev/openfeature-provider @openfeature/server-sdkOr
bun add,pnpm addoryarn add. -
Read the flag
import { OpenFeature } from "@openfeature/server-sdk" import { SlydogProvider } from "@slydogdev/openfeature-provider" await OpenFeature.setProviderAndWait( new SlydogProvider({ sdkKey: process.env.SLYDOG_SERVER_KEY, baseUrl: "https://api.slydog.dev", }), ) const flags = OpenFeature.getClient() const on = await flags.getBooleanValue("new-checkout", false, { targetingKey: user.id, })Set
SLYDOG_SERVER_KEYto your key and run it:onisfalse, because the flag is off. The second argument,false, is the default your code gets if the flag doesn't exist or Slydog can't be reached. -
Turn it on
In the app, open
new-checkoutin development and switch it On. The flag's Default rule decides what everyone gets when it's on. Set it to serveon, or a percentage rollout to give it to some of your users, and save.Your server picks up the change within moments, without restarting. Evaluate the flag again and
onistrue.