Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@playbookmedia/backend-client-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Vector TypeScript Client SDK
Official TypeScript SDK for Vector's Backend Services
Overview
This package provides a modern, type-safe TypeScript client for interacting with Vector's backend services. Built with TypeScript and following best practices, it offers a seamless integration experience with comprehensive type definitions and Promise-based APIs.
Features
- 🔒 Type Safety: Full TypeScript support with comprehensive type definitions
- 🚀 Modern Architecture: Promise-based API with async/await support
- 🛡️ Error Handling: Built-in error handling and retry mechanisms
- 📦 Zero Dependencies: Minimal production dependencies
- 🔄 Automatic Retries: Smart retry logic for failed requests
- 📚 Rich Documentation: Extensive documentation and examples
- ✨ IDE Support: Great IDE integration with TypeScript
Installation
# Using npm
npm install @playbookmedia/backend-typescript-sdk
# Using yarn
yarn add @playbookmedia/backend-typescript-sdk
# Using pnpm
pnpm add @playbookmedia/backend-typescript-sdkQuick Start
import { VectorClient } from '@playbookmedia/backend-typescript-sdk';
// Initialize the client
const client = new VectorClient({
apiKey: 'your-api-key',
environment: 'production' // or 'staging'
});
// Example: Using the client
async function example() {
try {
// Make API calls
const response = await client.someEndpoint({
// request parameters
});
console.log('Response:', response);
} catch (error) {
if (error instanceof VectorAPIError) {
console.error('API Error:', error.message);
console.error('Status:', error.status);
console.error('Code:', error.code);
} else {
console.error('Unexpected error:', error);
}
}
}API Reference
Client Configuration
interface VectorClientConfig {
apiKey: string;
environment?: 'production' | 'staging';
timeout?: number;
retryConfig?: {
maxRetries: number;
initialDelayMs: number;
};
}Available Methods
client.method1(): Description of method 1client.method2(): Description of method 2- More methods documented in our API Reference
Development
Prerequisites
- Node.js >= 12.0
- npm or yarn
Setup
Clone the repository:
git clone https://github.com/VectorEngineering/quills-protobuf-definitions.git cd quills-protobuf-definitions/sdk/client/client-typescript-sdk
Install dependencies:
npm install
Available Scripts
npm run build- Builds the package using TypeScriptnpm run clean- Removes build artifactsnpm run test- Runs tests with Jestnpm run lint- Lints code using ESLintnpm run format- Formats code using Prettiernpm run typecheck- Runs TypeScript type checkingnpm run semantic-release- Handles semantic versioning and releases
Testing
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageContributing
We welcome contributions! Please follow these steps:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
npm run cm(uses Commitizen) - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
Support
- 📧 Email: yoanyomba@solomon-ai.co
- 📚 Documentation: docs.vector.engineering
- 🐛 Issue Tracker: GitHub Issues
License
MIT © [Vector Engineering]