Skip to main content
This guide shows you how to integrate TypeConf into your Next.js project for type-safe configuration management.

Video Guide

Configuration Structure

Create your configuration files in a dedicated directory:
You can create multiple config files.

Define Your Schema

In configs/main.tsp:

Define Your Values

In configs/user-settings.config.ts:

Generate Config and Types

First install the React SDK:
Then generate the config and types:

Using in Next.js Server Components

Typeconf React SDK provides both server and client side helpers. Here’s how to use it in a server component:

Client-side Usage

For client-side configuration you need to add a provider to the layout:
Then in the component you can use the useTypeconf hook: