Type Safety

End-to-End Type Safety

TypeScript everywhere. From your database schema to your UI components.

typescript
1// 1. Define your Prisma schema
2model User {
3 id String @id @default(cuid())
4 email String @unique
5 name String?
6}
7
8// 2. Use in backend
9async createUser(dto: CreateUserDto): Promise<User> {
10 return this.db.user.create({ data: dto });
11}
12
13// 3. Call from frontend with full type safety
14const newUser = await wexts.users.createUser({
15 email: 'user@example.com',
16 name: 'John Doe'
17});
18// ^ TypeScript knows this returns User type

Benefits

Catch errors at compile time, not runtime. Get autocomplete everywhere.