This project is an example of how to use the featbit-react-client-sdk with Next.Js.
It is built based on the project bootstrapped with create-next-app.
This project uses the Pages, for example using App Router, please refer to the Next.js App Router example.
This example used withFfcProvider function to initialize the SDK.
Important In your project, you would need to add
@featbit/react-client-sdkto thetranspilePackageslist in the next.config.mjs file.
First, run the development server:
npm install
npm run devOpen http://localhost:3000 with your browser to see the result.
- next.config.mjs: add
@featbit/react-client-sdkto thetranspilePackageslist - FeatBitProvider.tsx: create a wrapper component to provide the context to descendant components, it is used in the
layout.tsxfile - test-component.tsx: a client component that consumes the fbClient and flags
