Flags 1.x is a release candidate. npm's latest tag still installs 0.x, so install these docs' version from the rc tag:
npm i @adonis-agora/flags@rc
node ace configure @adonis-agora/flagsThe same goes for every @adonis-agora/* package these docs install: add @rc, and where a page says node ace add, install with @rc first and then run node ace configure. On 0.x? Read the 0.x docs.
OpenFeature
Use @adonis-agora/flags through the OpenFeature server SDK.
If your code talks to the OpenFeature SDK, use the provider. It is the same engine: same buckets, same exposures, same results.
npm i @openfeature/server-sdkimport { OpenFeature } from '@openfeature/server-sdk'
import { AgoraFlagsProvider } from '@adonis-agora/flags/openfeature'
await OpenFeature.setProviderAndWait(new AgoraFlagsProvider())const client = OpenFeature.getClient()
await client.getBooleanValue('new_player', false, { targetingKey: user.id, plan: user.plan })
client.track('purchase', { targetingKey: user.id }, { value: order.total })targetingKey is the subject id; subjectType sets the subject type; every other attribute is a targeting attribute.
For other languages and the browser, see OFREP on the central server.