Getting started

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

With the Gatsby JS plugin you can add dynamic content for personalization to any component.

Gatsby JS

Install the gatsby-plugin-ninetailed modules via npm or yarn.

Install module via npm

npm install @ninetailed/gatsby-plugin-ninetailed @ninetailed/client-sdk-react

Install module via yarn

yarn add @ninetailed/gatsby-plugin-ninetailed @ninetailed/client-sdk-react

Gatsby JS + Contentful CMS

If you use Gatsby JS and Contentful as CMS install the gatsby-plugin-ninetailed and contentful-plugin-ninetailed modules via npm or yarn.

Install module via npm

npm install @ninetailed/gatsby-plugin-ninetailed @ninetailed/client-sdk-react @ninetailed/client-sdk-gatsby-contentful

Install module via yarn

yarn add @ninetailed/gatsby-plugin-ninetailed @ninetailed/client-sdk-react @ninetailed/client-sdk-gatsby-contentful

How to use

Just add the plugin to the plugins array in your gatsby-config.js and your API Key.

plugins: [
...your other gatsby plugins
{
resolve: `gatsby-plugin-ninetailed`,
options: {
apiKey: 'your api key'
}
}
]

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

By using the Gatsby JS plugin there's no need to configure the ProfileProvider or AnalyticsProvider as described in the React tutorial, as this is done by the plugin.

The plugin automatically tracks Pageviews on route change, please do not track it on your own as you would generate incorrect events.