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 App Router, for example using Pages, please refer to the Next.js Pages example.
This example used withFfcProvider
function to initialize the SDK.
First, run the development server:
npm install
npm run dev
Open http://localhost:3000 with your browser to see the result.
- fbConfig.ts: contains the configuration of the SDK
- FeatBitProvider.tsx: create a wrapper component to provide the context to descendant components, it is used in the
layout.tsx
file - test-component.tsx: a client component that consumes the fbClient and flags