SDKs
Official Software Development Kits (SDKs) for integrating 0.link into your applications. Our SDKs provide type-safe, feature-complete access to the 0.link platform with built-in error handling, retry logic, and best practices.
Available SDKs
JavaScript/TypeScript
Perfect for web applications, Node.js servers, and React/Vue projects.
- JavaScript SDK → - Complete documentation
- Package:
@0link/sdk - React Package:
@0link/react - Vue Package:
@0link/vue
Python
Ideal for backend services, data processing, and automation.
- Python SDK → - Complete documentation
- Package:
zerolink - Async Support: Built-in async/await support
Coming Soon
- Go SDK - For high-performance services
- PHP SDK - For web applications
- Ruby SDK - For Rails applications
- .NET SDK - For C# applications
Quick Comparison
| Feature | JavaScript | Python | Status |
|---|---|---|---|
| Type Safety | ✅ TypeScript | ✅ Type hints | Ready |
| Async/Await | ✅ | ✅ | Ready |
| React Hooks | ✅ | ❌ | Ready |
| Vue Composables | ✅ | ❌ | Ready |
| Retry Logic | ✅ | ✅ | Ready |
| WebSocket Support | ✅ | ✅ | Ready |
| File Upload | ✅ | ✅ | Ready |
| Rate Limiting | ✅ | ✅ | Ready |
Installation
JavaScript/Node.js
npm install @0link/sdk
# or
yarn add @0link/sdkReact
npm install @0link/react @0link/sdk
# or
yarn add @0link/react @0link/sdkVue
npm install @0link/vue @0link/sdk
# or
yarn add @0link/vue @0link/sdkPython
pip install zerolink
# or
poetry add zerolinkBasic Usage
JavaScript
import { ZeroLink } from '@0link/sdk';
const client = new ZeroLink({
apiKey: 'your_api_key_here'
});
// Get account information
const account = await client.account.get();
// List projects
const projects = await client.projects.list();
// Create a project
const project = await client.projects.create({
name: 'My New Project',
description: 'A sample project'
});Python
from zerolink import Client
client = Client(api_key='your_api_key_here')
# Get account information
account = client.account.get()
# List projects
projects = client.projects.list()
# Create a project
project = client.projects.create(
name='My New Project',
description='A sample project'
)SDK Features
Authentication
All SDKs handle authentication automatically using your API key.
Error Handling
Built-in error handling with detailed error information and retry logic.
Type Safety
Full TypeScript support (JavaScript) and type hints (Python).
Rate Limiting
Automatic rate limit handling with exponential backoff.
Pagination
Simple pagination with cursor-based navigation.
File Uploads
Streamlined file upload with progress tracking.
WebSocket Support
Real-time updates through WebSocket connections.
Framework Integration
React Hooks
import { ZeroLinkProvider, useProjects } from '@0link/react';
function App() {
return (
<ZeroLinkProvider apiKey="your_api_key">
<ProjectsList />
</ZeroLinkProvider>
);
}
function ProjectsList() {
const { projects, loading, error } = useProjects();
if (loading) return <div>Loading...</div>;
if (error) return <div>Error: {error.message}</div>;
return (
<ul>
{projects.map(project => (
<li key={project.id}>{project.name}</li>
))}
</ul>
);
}Vue Composables
<template>
<div>
<div v-if="loading">Loading...</div>
<div v-else-if="error">Error: {{ error.message }}</div>
<ul v-else>
<li v-for="project in projects" :key="project.id">
{{ project.name }}
</li>
</ul>
</div>
</template>
<script setup>
import { useProjects } from '@0link/vue';
const { projects, loading, error } = useProjects();
</script>Configuration Options
JavaScript Configuration
const client = new ZeroLink({
apiKey: 'your_api_key',
environment: 'production', // or 'development'
timeout: 10000, // Request timeout in ms
retryAttempts: 3, // Number of retry attempts
retryDelay: 1000, // Base retry delay in ms
baseURL: 'https://api.0link.com/v2', // Custom base URL
debug: false // Enable debug logging
});Python Configuration
client = Client(
api_key='your_api_key',
environment='production', # or 'development'
timeout=10.0, # Request timeout in seconds
retry_attempts=3, # Number of retry attempts
retry_delay=1.0, # Base retry delay in seconds
base_url='https://api.0link.com/v2', # Custom base URL
debug=False # Enable debug logging
)Error Handling
JavaScript
try {
const project = await client.projects.create(projectData);
} catch (error) {
if (error.code === 'VALIDATION_ERROR') {
console.log('Validation failed:', error.details);
} else if (error.code === 'RATE_LIMIT_EXCEEDED') {
console.log('Rate limited, retry after:', error.retryAfter);
} else {
console.log('Unexpected error:', error.message);
}
}Python
from zerolink.exceptions import ValidationError, RateLimitError
try:
project = client.projects.create(project_data)
except ValidationError as e:
print(f'Validation failed: {e.details}')
except RateLimitError as e:
print(f'Rate limited, retry after: {e.retry_after}')
except Exception as e:
print(f'Unexpected error: {e}')Testing Support
Mock Clients
// JavaScript
import { MockZeroLink } from '@0link/sdk/testing';
const mockClient = new MockZeroLink({
projects: [
{ id: '1', name: 'Test Project' }
]
});# Python
from zerolink.testing import MockClient
mock_client = MockClient(
projects=[
{'id': '1', 'name': 'Test Project'}
]
)Migration Guide
From Direct API Calls
If you're currently using direct API calls, migrating to an SDK is straightforward:
// Before: Direct API calls
const response = await fetch('https://api.0link.com/v2/projects', {
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
}
});
const projects = await response.json();
// After: Using SDK
const projects = await client.projects.list();Version Compatibility
| SDK Version | API Version | Node.js | Python |
|---|---|---|---|
| 2.x | v2 | ≥14 | ≥3.8 |
| 1.x | v1 (deprecated) | ≥12 | ≥3.7 |
Performance Tips
- Reuse Client Instances: Create one client instance and reuse it
- Use Pagination: Don't fetch all data at once
- Implement Caching: Cache frequently accessed data
- Handle Rate Limits: Implement proper retry logic
- Use Batch Operations: Group related operations when possible
Getting Help
- Documentation: Detailed guides for each SDK
- Examples: Sample code and tutorials
- Support: Email support@0link.com
- GitHub: Report issues and contribute
- Community: Join our developer Discord
Next Steps
- JavaScript SDK → - Complete JavaScript documentation
- Python SDK → - Complete Python documentation
- React Integration → - React-specific guide
- Vue Integration → - Vue-specific guide