Getting Started with wexts
Build from the verified Wexts 4 starter with generated RPC, a production runtime, and explicit release checks.
Prerequisites
Installation
The fastest path is the published Wexts CLI. It creates the verified Hello RPC starter.
npx wexts create my-app
cd my-app
pnpm install
pnpm run devProject Created!
wexts start runtime path.Project Structure
After installation, your project will have the following structure:
1my-app/2├── apps/3│ ├── web/ # Next.js frontend4│ │ ├── app/5│ │ └── lib/6│ └── api/ # NestJS backend7│ ├── src/8│ └── tsconfig.json9├── wexts.runtime.js10├── pnpm-workspace.yaml11├── package.json12└── README.mdKey Features Overview
RPC Auto-Linking
Call backend functions from your frontend with full type safety. Generated from explicit RPC metadata and committed manifest output.
Powerful CLI
Generate components, services, and modules with a single command. Boost your productivity.
Type Safety
TypeScript across backend service signatures and frontend calls.
Modern Stack
Built with Next.js 16, React 19, NestJS 11, Fastify 5, and TypeScript 5.9.
Creating Your First Endpoint
Let's create a simple explicitly decorated RPC service. First, create a new service in your backend:
npx wexts generate rpc helloThis will create a new service file. Update it with your logic:
1import { Injectable } from '@nestjs/common';2import { RpcMethod, RpcService } from 'wexts/nest';34@Injectable()5@RpcService({ name: 'hello', requireAuth: false })6export class HelloService {7 @RpcMethod()8 async sayHello(name: string): Promise<string> {9 return `Hello, ${name}! Welcome to wexts.`;10 }11}Now you can call this from your frontend with full type safety:
1'use client';23import { useWexts } from '@/lib/wexts-client';45export default function Page() {6 const wexts = useWexts();78 const handleClick = async () => {9 // Fully typed! Your IDE knows about sayHello10 const result = await wexts.hello.sayHello('World');11 console.log(result); // "Hello, World! Welcome to wexts."12 };1314 return <button onClick={handleClick}>Say Hello</button>;15}Magic! ✨
wexts generate after adding or changing RPC services.Next Steps
Now that you have a basic understanding, explore these topics:
- Learn more about generated RPC
- Understand the production runtime
- Check out CLI commands
- Read known limitations
Need help? Join our Discord community or open an issue on GitHub.