@modsynth/api-client
v0.2.0
Published
REST API client based on Axios
Readme
API Client
REST API client based on Axios
Part of the Modsynth ecosystem.
Features
- Axios-based HTTP client
- Automatic authentication token handling
- Request/response interceptors
- TypeScript support
Installation
npm install @modsynth/api-clientQuick Start
import ApiClient from '@modsynth/api-client';
const client = new ApiClient({
baseURL: 'https://api.example.com',
timeout: 30000,
});
// Set auth token
client.setAuthToken('your-token');
// GET request
const users = await client.get('/users');
// POST request
const newUser = await client.post('/users', {
name: 'John',
email: '[email protected]',
});
// PUT request
await client.put('/users/1', { name: 'Jane' });
// DELETE request
await client.delete('/users/1');Version
Current version: v0.1.0
License
MIT
