Skip to content

Next

Install Kilpi for Next

Ensure you have setup Kilpi using the quickstart guide before proceeding.

Install plugins

Install the React Server Components Plugin (@kilpi/react-server) to use Kilpi with React Server Components.

Optional: Install the React Client Components Plugin (@kilpi/react-client) for component and hook bindings into @react/client on the client.

Provide a scope for server actions and endpoints

The React Server Components Plugin can’t automatically provide a scope for server actions or endpoints as there is no global request-scoped API. You have to do this manually with Kilpi.runInScope to use all Kilpi features, such as Kilpi.onUnauthorized.

The ReactServerComponentPlugin from @kilpi/react-server automatically provides a scope for react server components.