Reflag
The Reflag provider contains support for Reflag's feature management tools.
Reflag is agent-ready feature flags for TypeScript
The @flags-sdk/reflag
provider package exports
- An adapter for flags from Reflag.
- A getProviderData function for use with the Flags Explorer.
Learn more about Adapters
Learn more about the Flags Explorer
Deploy the Reflag template
Setup
The Reflag provider is available in the @flags-sdk/reflag
module. Install it with
Provider Instance
Import the default adapter instance reflagAdapter
from @flags-sdk/reflag
:
If you need a customized setup, you can import createReflagAdapter
from @flags-sdk/reflag
and create an adapter instance with your settings:
See the Reflag NodeSDK documentation for the full list of options.
Identify Users and Companies
The Reflag provider uses the identify
property to identify users and companies. The identify
function is called for every request to determine the user and company context.
Reflag relies on a setting a user/company to evaluate flags for a given request.
Set the identify
property to a function which returns a Reflag Context
containing user/company properties:
Learn more about dedupe
Learn more about identify
Methods
Feature toggling
Through the featureIsEnabled
method, the Reflag provider supports determining if features are enabled/disabled.
Remote Config, Adoption tracking and automatic feedback surveys are currently not supported in the Reflag Flags SDK provider.
"Checks" events
Check events are used to log when a user is exposed to a feature. Because middleware and server components are evaluated when routes are prefetched, check events are not supported in the Reflag Provider.
See the Reflag React SDK documentation for more information on how to use check events in the client.
Flags Explorer
View and override your Reflag feature toggles using the Flags Explorer.
To make Flags Explorer aware of your Reflag features, you need to provide a route which Flags Explorer will load your experiment metadata from.
Use the getProviderData
function in your Flags API endpoint to load and emit your Reflag data.
getProviderData
takes a ReflagClient
in the options
object:
Read More
Read more about Reflag, Flags SDK, and the Reflag adapter.