Overview
Better Uptime uses tRPC for type-safe API communication between the client and server. tRPC provides end-to-end type safety without code generation, making it ideal for full-stack TypeScript applications.Key Features
- Type-safe: Full TypeScript support with automatic type inference
- No code generation: Types are derived directly from your API implementation
- Real-time validation: Input and output validation using Zod schemas
- JWT authentication: Secure authentication with protected and public procedures
Available Routers
The API is organized into the following routers:User Router
Handles authentication and user management:- User signup and login
- GitHub OAuth authentication
- Email verification
- User profile retrieval
Website Router
Manages website monitoring:- Create and update monitored websites
- Retrieve website status and uptime data
- Delete websites
Status Page Router
Manages public status pages:- Create and configure status pages
- Update status page content
- List and retrieve status pages
Status Domain Router
Handles custom domains for status pages:- Add custom domains
- Configure DNS settings
- Verify domain ownership
Import Example
All routers and utilities are exported from the@repo/api package:
Creating a Router
Routers are created using therouter function and can include both public and protected procedures:
Type Inference
Extract input and output types from your routers:Next Steps
Authentication
Learn how to authenticate users and protect routes
User Router
Explore user management endpoints
Website Router
Monitor websites and track uptime
Status Page Router
Create and manage status pages