@kotao/api
v1.2.0
Published
Type-safe API client for Kotao - Built with Elysia and Eden Treaty
Maintainers
Readme
@kotao/api
Type-safe API client for Kotao built with Elysia and Eden Treaty.
Installation
npm install @kotao/apiUsage
import { createApiClient } from '@kotao/api/client'
// Uses https://api.kotao.com by default
const api = createApiClient()
// Or specify a custom URL
const api = createApiClient('https://api.staging.kotao.com')
// Full type safety and autocomplete for all endpoints
const { data, error } = await api.v1.workspaces.get()
if (error) {
console.error('Failed to fetch workspaces:', error)
} else {
console.log('Workspaces:', data)
}TypeScript Support
This package provides full TypeScript support with autocomplete for all API endpoints:
- Request parameters are type-checked
- Response types are inferred automatically
- Error types are strongly typed
Requirements
- Node.js 18+ or Bun 1.0+
- TypeScript 5.0+
License
MIT
