Getting started

This guide describes the steps you need to follow to add Ninetailed to Next.js.

With the Next.js SDK you can add dynamic content for personalization to any component.

Install Next.js SDK

Install the @ninetailed/client-sdk-nextjs module via npm or yarn.

Install module via npm

npm install @ninetailed/client-sdk-nextjs

Install module via yarn

yarn add @ninetailed/client-sdk-nextjs

How to use

This is what the configuration of @ninetailed/client-sdk-nextjs looks like:

import React from 'react';
import {
PersonalizationProvider
} from '@ninetailed/client-sdk-nextjs';
export const App = () => {
return (<>
<PersonalizationProvider apiKey={YOUR_API_KEY}>
<YourAppCode />
</ProfileProvider>
</>);
}

Your API Key can be found in the CMS or Ninetailed dashboard configuration.

Contentful app configuration screen

Next you need to set the PersonalizationProvider. We recommend to simply wrap your app component with both providers.