Getting Started
This guide describes the steps you need to follow to add Ninetailed to React JS.
With the React SDK, you can add dynamic content for personalization to any component.
Install the
@ninetailed/experience.js-react
module via npm or yarn.npm install @ninetailed/experience.js-react
yarn add @ninetailed/experience.js-react
This is what the configuration of
@ninetailed/experience.js-react
looks like:import React from 'react';
import {
NinetailedProvider
} from '@ninetailed/experience.js-react';
export const App = () => {
return (<>
<NinetailedProvider
/* required */
clientId="Your_API_Key"
/* The environment defaults to main - set this if you want to use another */
environment="main"
/* If the preview is enabled Draft Audiences will be applied to the profile */
preview={false}
/* Sets needed plugins */
plugins=[]
/* Translate Location names to the set locale - useful for Mergetags */
locale="en-US"
/* The maximum loading time until the fallback (Baseline) will be shown */
requestTimeout={500}
/* The profile can be set, when you got that information from SSR or ESR */
profile={profileFormSSR}
/* An array of all Ninetailed experiment entries from your CMS.*/
experiments={ninetailedExperiments}
>
<YourAppCode />
</AnalyticsProvider>
</>);
}
Last modified 3mo ago