@cvo/client
v0.0.0
Published
Client package for CVO Framework
Readme
@cvo/client
The lightweight frontend runtime for the CVO Framework. It provides the core communication layer between your frontend application and the CVO backend.
🚀 Key Features
- Zero-Overhead Runtime: Extremely small footprint, adding minimal size to your production bundle.
- Universal Compatibility: First-class support for Vue 3, React, UniApp, Taro, and more.
- Platform-Agnostic Requester: Automatically detects the environment and selects the optimal network requester (e.g.,
fetch,uni.request, orTaro.request). - Type-Safe RPC: Works seamlessly with
@cvo/compilerto provide end-to-end type definitions for all API calls.
🛠 Usage
While @cvo/client is often used indirectly through generated SDKs or Vite transformations, you can also use it manually for advanced scenarios:
import { createClient } from '@cvo/client';
import type { MyApi } from './generated/api';
const client = createClient<MyApi>({
baseUrl: 'https://api.myapp.com'
});
// Fully type-safe call
const result = await client.getUser({ id: '123' });🔌 Adaptors
@cvo/client is extensible through adaptors. If you're using a custom framework or environment, you can provide a custom Requester implementation to handle network communication.
