HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog In

## Version

SDK v2.2.0

## Description

The OptimizelyProvider leverages React’s Context API to allow access to the ReactSDKClient to components like OptimizelyFeature and OptimizelyExperiment.

## Props

The table below lists the required and optional props for the OptimizelyFeature Component in React.

**optimizely**ReactSDKClientOptimizely instance created from calling `createInstance`
**user**object: { id: string; attributes?: { "h-0": "Param\: any } } | Promise User infoThe user id and user attributes to be passed to the SDK for every feature flag, A/B test, or track call, or a Promise for the same kind of object.
**timeout** _optional_numberThe amount of time for OptimizelyExperiment and OptimizelyFeature components to render null while waiting for the SDK instance to become ready, before resolving.
**isServerSide** _optional_booleanmust pass true here for server side rendering

## Examples

If the root component of your application was <App>, wrap your App with the OptimizelyProvider component. Pass the result of calling `createInstance` to the `optimizely` prop and set the `user` object with `id` and `attributes` identifying the user:

## Source files

The language/platform source files containing the implementation for React is [index.ts](🔗).