Skip to main content
Integrating your frontend with Mizu’s backend is straightforward. This guide covers patterns, best practices, and common scenarios.

Basic API Call

Frontend

Backend

Request Methods

GET

POST

PUT/DELETE

Error Handling

Frontend

Backend

Authentication

JWT Token

Or use the JWT middleware:

HTTP-Only Cookies

Frontend doesn’t need to handle the cookie - it’s sent automatically.

CORS in Development

Mizu adds CORS headers automatically in dev mode:
For production, use the CORS middleware:

TypeScript Types

Share types between frontend and backend:
Frontend:

API Client

Create a reusable API client:
Use:

Loading States

Pagination

Backend

Frontend

File Upload

Frontend

Backend

Next Steps

SSR vs SPA

Architecture decisions

Security

API security best practices

CORS Middleware

CORS configuration

JWT Middleware

JWT authentication