Starting and Configuring the SDK
This feature starts the Flagship SDK using your specific credentials and the necessary configuration parameters. This is typically the initial step when utilizing the Flagship SDK.
In the context of the Flagship SDK, a "decision" refers to the process of assigning variations to a visitor based on the targeting criteria of a campaign.
You can use either the Api
mode or the Bucketing
mode to start the SDK. In the API
mode whenever you fetch your flags, an HTTP request is made to Flagship to take decisions. However in Bucketing
mode, the decisions are made locally on the client side.
It's recommended to start the SDK just once in the most appropriate location for your application.
Below are examples of how to initialize and configure the SDK in different programming environments:
import { Flagship, DecisionMode, CacheStrategy, LogLevel } from "@flagship.io/js-sdk";
await Flagship.start("<ENV_ID>", "<API_KEY>", {
deciswaionMode: DecisionMode.DECISION_API,
timeout: 10,
logLevel: LogLevel.INFO,
});
Each SDK offers a variety of configuration options to manage its behavior. For more detailed information about possible configurations, please consult the reference documentation for your specific SDK:
Last updated
Was this helpful?