Usage
Using TypeConf with Next.js
Learn how to use TypeConf in your Next.js projects
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:
Define Your Schema
In configs/main.tsp
:
Define Your Values
In configs/values.config.ts
:
Generate Config and Types
First install the 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:
Was this page helpful?