Reference
FlagshipProvider
FlagshipProvider <th style={{ textAlign: "left" }}>
Type
</th>
<th style={{ textAlign: "left" }}>
Default
</th>
<th style={{ textAlign: "left" }}>
Description
</th>
</tr> <td style={{ textAlign: "left" }}>
string
</td>
<td style={{ textAlign: "left" }}>
Required
</td>
<td style={{ textAlign: "left" }}>
Environment id provided by Flagship.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
apiKey
</td>
<td style={{ textAlign: "left" }}>
string
</td>
<td style={{ textAlign: "left" }}>
Required
</td>
<td style={{ textAlign: "left" }}>
Api authentication key provided by Flagship.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
decisionMode
</td>
<td style={{ textAlign: "left" }}>
`DECISION-API`|`BUCKETING`|`BUCKETING_EDGE`
</td>
<td style={{ textAlign: "left" }}>
`DECISION-API`
</td>
<td style={{ textAlign: "left" }}>
The SDK running mode. [see `Decision Mode`](#decision-mode)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
fetchNow
</td>
<td style={{ textAlign: "left" }}>
boolean
</td>
<td style={{ textAlign: "left" }}>
true
</td>
<td style={{ textAlign: "left" }}>
Determines whether to automatically fetch flags data when creating a new `Visitor`.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
visitorData
</td>
<td style={{ textAlign: "left" }}>
object
</td>
<td style={{ textAlign: "left" }}>
Required
</td>
<td style={{ textAlign: "left" }}>
This is the data to identify the current visitor using your app. \*\*[See arguments](#visitordata) \*\*
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
reuseVisitorIds
</td>
<td style={{ textAlign: "left" }}>
boolean
</td>
<td style={{ textAlign: "left" }}>
true
</td>
<td style={{ textAlign: "left" }}>
**client-side only**
If true, the SDK will save the visitor ID and/or anonymous ID, and reuse it for the next session if `visitorId` is not set, to maintain cross-session visitor experience.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
loadingComponent
</td>
<td style={{ textAlign: "left" }}>
ReactNode
</td>
<td style={{ textAlign: "left" }}>
undefined
</td>
<td style={{ textAlign: "left" }}>
This component will be rendered when Flagship is loading at first initialization only.
By default, the value is` undefined`. It means it will display your app and it might display default flags value for a very short moment.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
shouldSaveInstance
</td>
<td style={{ textAlign: "left" }}>
boolean
</td>
<td style={{ textAlign: "left" }}>
`true`
</td>
<td style={{ textAlign: "left" }}>
If true, the newly created visitor instance will be returned and saved into Flagship. Otherwise, the newly created visitor instance won't be saved and will simply be returned.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
initialCampaigns
</td>
<td style={{ textAlign: "left" }}>
object
</td>
<td style={{ textAlign: "left" }}>
`undefined`
</td>
<td style={{ textAlign: "left" }}>
***Optional***
An object containing the data received when fetching the Flagship decision API (decisionMode="API").
Providing this property avoids the SDK from having an empty cache during first initialization.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
initialFlagsData
</td>
<td style={{ textAlign: "left" }}>
array
</td>
<td style={{ textAlign: "left" }}>
`undefined`
</td>
<td style={{ textAlign: "left" }}>
***Optional***
A [set](#serializedflagmetadata) of flag data provided to avoid the SDK from having an empty cache during the first initialization.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
onFetchFlagsStatusChanged
</td>
<td style={{ textAlign: "left" }}>
function(object):void
</td>
<td style={{ textAlign: "left" }}>
`undefined`
</td>
<td style={{ textAlign: "left" }}>
***Optional***
Callback function that will be called when the fetch flags status changes.
[see arguments](#onfetchflagsstatuschanged)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
timeout
</td>
<td style={{ textAlign: "left" }}>
number
</td>
<td style={{ textAlign: "left" }}>
2
</td>
<td style={{ textAlign: "left" }}>
The timeout in seconds for API requests.
Timeout can't be lower than 0 second.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
logLevel
</td>
<td style={{ textAlign: "left" }}>
number
</td>
<td style={{ textAlign: "left" }}>
9
</td>
<td style={{ textAlign: "left" }}>
The maximum log level to display. [see`LogLevel`](#loglevel)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
logManager
</td>
<td style={{ textAlign: "left" }}>
object
</td>
<td style={{ textAlign: "left" }}>
Defined
</td>
<td style={{ textAlign: "left" }}>
A custom implementation of the LogManager interface to receive logs from the SDK.
The object must fill the Interface [`IFlagshipLogManager`](#iflagshiplogmanager)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
decisionApiUrl
</td>
<td style={{ textAlign: "left" }}>
string
</td>
<td style={{ textAlign: "left" }}>
[https://decision.flagship.io/v2](https://decision.flagship.io/v2)
</td>
<td style={{ textAlign: "left" }}>
This setting can be useful if you need to simulate the API for tests such as end-to-end or if you want to move to an earlier version of the Flagship API.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
pollingInterval
</td>
<td style={{ textAlign: "left" }}>
number
</td>
<td style={{ textAlign: "left" }}>
5
</td>
<td style={{ textAlign: "left" }}>
**Bucketing mode only**\
The time in seconds between two bucketing polling requests.
If 0 is given, it will only poll once at start time.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
hitDeduplicationTime
</td>
<td style={{ textAlign: "left" }}>
number
</td>
<td style={{ textAlign: "left" }}>
2.5
</td>
<td style={{ textAlign: "left" }}>
The delay in seconds for hit deduplication. After a hit is sent, any future attempts to send the same hit will be blocked until the specified delay has expired.
If the value is 0, no deduplication process will be applied.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
initialBucketing
</td>
<td style={{ textAlign: "left" }}>
object
</td>
<td style={{ textAlign: "left" }}>
undefined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
An object containing the data received when fetching the bucketing endpoint.
Providing this object will make bucketing ready to use and the first polling will immediately check for updates.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
visitorCacheImplementation
</td>
<td style={{ textAlign: "left" }}>
object
</td>
<td style={{ textAlign: "left" }}>
Defined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
An object that implements the [`visitorCacheImplementation`](#visitor-cache) interface to handle the visitor cache. [see cache management](#cache-management)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
hitCacheImplementation
</td>
<td style={{ textAlign: "left" }}>
object
</td>
<td style={{ textAlign: "left" }}>
Defined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
An object that implements the [`IHitCacheImplementation`](#hit-cache) , interface to manage hits cache. [see cache management](#cache-management)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
disableCache
</td>
<td style={{ textAlign: "left" }}>
boolean
</td>
<td style={{ textAlign: "left" }}>
false
</td>
<td style={{ textAlign: "left" }}>
If set to true, hit cache and visitor cache will be disabled; otherwise, they will be enabled.. [see cache management](#cache-management)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
onSdkStatusChanged
</td>
<td style={{ textAlign: "left" }}>
function(number):void
</td>
<td style={{ textAlign: "left" }}>
undefined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
A callback function to be called when the SDK status has changed. [see arguments](#onsdkstatuschanged).
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
onBucketingSuccess
</td>
<td style={{ textAlign: "left" }}>
function(object):void
</td>
<td style={{ textAlign: "left" }}>
undefined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
A callback function to be called when the first bucketing polling succeeds. [see arguments](#onbucketingsuccess)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
onBucketingFail
</td>
<td style={{ textAlign: "left" }}>
function(error):void
</td>
<td style={{ textAlign: "left" }}>
undefined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
A callback function to be called when the first bucketing polling fails. [see arguments](#onbucketingfail)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
onBucketingUpdated
</td>
<td style={{ textAlign: "left" }}>
function(object):void
</td>
<td style={{ textAlign: "left" }}>
undefined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
A callback function to be called each time bucketing data from Flagship has been updated. [see arguments](#onbucketingupdated)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
onLog
</td>
<td style={{ textAlign: "left" }}>
function(level: LogLevel, tag: string, message: string):void
</td>
<td style={{ textAlign: "left" }}>
undefined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
A callback function to be called whenever the SDK needs to report a log.
[see arguments](#onlog)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
trackingManagerConfig
</td>
<td style={{ textAlign: "left" }}>
object
</td>
<td style={{ textAlign: "left" }}>
defined
</td>
<td style={{ textAlign: "left" }}>
Options to configure hit batching.\
[trackingManagerConfig](#tracking-manager-config)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
onVisitorExposed
</td>
<td style={{ textAlign: "left" }}>
function(object):void
</td>
<td style={{ textAlign: "left" }}>
undefined
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
A callback function to be called each time a flag is exposed to a visitor (i.e., when an activation hit is sent by the SDK).
[see arguments](#onvisitorexposed)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
fetchThirdPartyData
</td>
<td style={{ textAlign: "left" }}>
boolean
</td>
<td style={{ textAlign: "left" }}>
false
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
**Bucketing mode only**
If true, the SDK will fetch the visitor's segment from the [universal data connector](https://developers.abtasty.com/docs/data/universal-data-connector) each time `fetchFlags` is called and append those segments in the visitor context.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
nextFetchConfig
</td>
<td style={{ textAlign: "left" }}>
object
</td>
<td style={{ textAlign: "left" }}>
\{ revalidate: 20 }
</td>
<td style={{ textAlign: "left" }}>
**Optional**\
In Next.js 13, you can define the time in seconds for storing SDK route cache before revalidation. [learn more](https://nextjs.org/docs/app/building-your-application/data-fetching/caching#per-request-caching)
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
fetchFlagsBufferingTime
</td>
<td style={{ textAlign: "left" }}>
number
</td>
<td style={{ textAlign: "left" }}>
2
</td>
<td style={{ textAlign: "left" }}>
**Optional**
The delay in seconds for buffering fetch flags calls. After the SDK has fetched flags, they will be buffered for the specified delay. During this delay, any subsequent fetch flags calls will return the same flags.
**Note:**
If a value of 0 is given, no buffering process will be applied.
If visitor data has changed, the buffering will be bypassed.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
disableDeveloperUsageTracking
</td>
<td style={{ textAlign: "left" }}>
boolean
</td>
<td style={{ textAlign: "left" }}>
false
</td>
<td style={{ textAlign: "left" }}>
Determines whether to disable the collection of analytics data.
</td>
</tr>
<tr>
<td style={{ textAlign: "left" }}>
fetchFlagsOnBucketingUpdated
</td>
<td style={{ textAlign: "left" }}>
boolean
</td>
<td style={{ textAlign: "left" }}>
false
</td>
<td style={{ textAlign: "left" }}>
**Bucketing mode only**\
If true, it'll automatically call fetchFlags when the bucketing file has updated.
</td>
</tr>Attribute
visitorData
key
Decision Mode
Key
Value
Type
Description
onLog
Argument
Type
Description
LogLevel
Key
Value
Type
Description
IFlagshipLogManager
Argument
onSdkStatusChanged
Argument
Type
Description
FSSdkStatus)
Key
Value
Type
Description
onBucketingSuccess
Key/Property
Type
Description
onBucketingFail
Argument
Type
Description
onBucketingUpdated
Argument
Type
Description
OnVisitorExposed
Argument
Type
Description
Key/Property
Key/Property
Type
Description
Key/Property
Type
Description
onFetchFlagsStatusChanged
Argument
Type
Description
FetchFlagsStatus
Key/Property
Type
Description
Key
Type
Description
Key
Type
Description
Tracking Manager Config
Key
CacheStrategy
Key
useFlagship hook
useFlagship hookKey/Property
setConsent method
setConsent methodArgument
Type
Default
Description
updateContext method
updateContext methodArgument
Type
Description
clearContext method
clearContext methodContext with predefined keys of context
fetchFlags method
fetchFlags methodgetFlag method
getFlag methodName
Type
Description
getFlags method
getFlags methodauthenticate method
authenticate methodArgument
Type
Default
Description
unauthenticate method
unauthenticate methodsendHits method
sendHits methodname
Type
Default
Description
useFsFlag hook
useFsFlag hookArgument
Type
Description
IFSFlag interface
IFSFlag interfacemetadata property
metadata propertystatus property
status propertyKey
Type
Description
getValue method
getValue methodName
visitorExposed method
visitorExposed methodexists method
exists methodIFSFlagCollection interface
IFSFlagCollection interfacesize property
size propertyget method
get methodName
Type
Description
has method
has methodName
Type
Description
keys method
keys methodfilter method
filter methodName
Type
Description
exposeAll method
exposeAll methodgetMetadata method
getMetadata methodtoJSON method
toJSON methodforEach method
forEach methodIFSFlagMetadata interface
IFSFlagMetadata interfaceKey
Type
Description
SerializedFlagMetadata
Key
Type
Description
Hit Tracking
HitType
Key
type
Value
Description
Common Optional Parameters for Hits
Parameter
Type
Description
Page hit
Key/Property
Type
Default
Description
Screen hit
Key/Property
Type
Default
Description
Transaction hit
Key/Property
Type
Default
Description
Item hit
Key/Property
Type
Default
Description
Event hit
Key/Property
Cache management
Visitor Cache
cacheVisitor method
cacheVisitor methodArgument
Type
Description
lookupVisitor method
lookupVisitor methodArgument
Type
Description
flushVisitor method
flushVisitor methodArgument
Type
Description
VisitorCacheDTO
Hit Cache
cacheHit method
cacheHit methodArgument
lookupHits method
lookupHits methodflushHits function
flushHits functionArgument
Type
Description
flushAllHits function
flushAllHits functionHitCacheDTO
IHitCacheImplementation implementation
IHitCacheImplementation implementationPredefined visitor context keys
SDK constant Name
Description
Context variable name
Type
Auto-set by SDK
Example
Last updated
Was this helpful?

