Skip to content
ViGrise Platform

Libraries (SDK)

Official SDKs to integrate our API into your applications. Choose your preferred programming language and get started in minutes.

We provide official SDKs for the most popular programming languages:

LanguagePackageDocumentationRepository
JavaScript/TypeScript@vigrise/sdkDocsGitHub
PythonvigriseDocsGitHub
Gogithub.com/vigrise/sdk-goDocsGitHub
Javacom.vigrise:sdkDocsGitHub
PHPvigrise/sdkDocsGitHub
RubyvigriseDocsGitHub
C#Vigrise.SDKDocsGitHub
RustvigriseDocsGitHub

Terminal window
npm install @vigrise/sdk
# or
yarn add @vigrise/sdk
# or
pnpm add @vigrise/sdk
import { VigriseClient } from '@vigrise/sdk';
// Initialize the client
const client = new VigriseClient({
apiKey: 'your-api-key-here',
});
// Make your first API call
async function example() {
try {
const response = await client.process({
input: 'Hello, World!',
options: {
format: 'json',
},
});
console.log(response.data);
} catch (error) {
console.error('Error:', error.message);
}
}
example();

The SDK is written in TypeScript and provides full type definitions out of the box.

import { VigriseClient, ProcessOptions, ProcessResponse } from '@vigrise/sdk';
const client = new VigriseClient({ apiKey: process.env.VIGRISE_API_KEY });
const options: ProcessOptions = {
input: 'Sample input',
format: 'json',
timeout: 5000,
};
const response: ProcessResponse = await client.process(options);

All SDKs support multiple authentication methods:

Pass your API key when initializing the client:

const client = new VigriseClient({ apiKey: 'your-api-key-here' });

Set your API key as an environment variable:

Terminal window
export VIGRISE_API_KEY=your-api-key-here

Then initialize without explicitly passing the key:

const client = new VigriseClient(); // Automatically reads from env

Create a configuration file at ~/.vigrise/config.json:

{
"apiKey": "your-api-key-here",
"baseUrl": "https://api.vigrise.com"
}

All SDKs provide these core features:

try {
const response = await client.process({ input: 'data' });
} catch (error) {
if (error.code === 'RATE_LIMIT_EXCEEDED') {
console.log('Rate limit exceeded, try again later');
} else if (error.code === 'INVALID_API_KEY') {
console.log('Invalid API key');
} else {
console.log('An error occurred:', error.message);
}
}

All SDKs include automatic retry with exponential backoff:

const client = new VigriseClient({
apiKey: 'your-api-key-here',
maxRetries: 3,
retryDelay: 1000, // milliseconds
});
const client = new VigriseClient({
apiKey: 'your-api-key-here',
timeout: 30000, // 30 seconds
});

For enterprise or self-hosted deployments:

const client = new VigriseClient({
apiKey: 'your-api-key-here',
baseUrl: 'https://your-custom-domain.com',
});

Process multiple requests efficiently:

const results = await client.batch([
{ input: 'First input' },
{ input: 'Second input' },
{ input: 'Third input' },
]);
results.forEach((result, index) => {
console.log(`Result ${index + 1}:`, result.data);
});

For long-running operations:

const stream = await client.processStream({ input: 'large data' });
stream.on('data', (chunk) => {
console.log('Received chunk:', chunk);
});
stream.on('end', () => {
console.log('Stream completed');
});
stream.on('error', (error) => {
console.error('Stream error:', error);
});

Configure webhook callbacks for async operations:

await client.process({
input: 'data',
webhook: {
url: 'https://your-domain.com/webhook',
events: ['completed', 'failed'],
},
});

All SDKs automatically handle rate limits and provide rate limit information:

const response = await client.process({ input: 'data' });
console.log('Rate Limit:', response.rateLimit.limit);
console.log('Remaining:', response.rateLimit.remaining);
console.log('Reset:', new Date(response.rateLimit.reset));

All SDKs support testing with mock responses:

import { VigriseClient, mockResponse } from '@vigrise/sdk/testing';
// In your tests
const client = new VigriseClient({ apiKey: 'test-key' });
client.mock(mockResponse({ data: 'mocked data' }));
const response = await client.process({ input: 'test' });
expect(response.data).toBe('mocked data');


Upgrading from an older version? Check out our migration guides:


We welcome contributions to our SDKs! Each repository has its own contribution guidelines:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

See individual SDK repositories for detailed contribution guidelines.