Acontext provides official SDKs for Python and TypeScript/JavaScript, making it easy to integrate Acontext into your applications. The SDKs handle authentication, request formatting, and provide type-safe interfaces to all Acontext features.
For Node.js environments, the SDK may require optional peer dependencies node-fetch and form-data for file uploads and network requests in older Node versions.
After installation, verify your setup with a quick connection test:
Python
TypeScript
Copy
from acontext import AcontextClient# Initialize the clientclient = AcontextClient( api_key="sk-ac-your-root-api-bearer-token", base_url="http://localhost:8029/api/v1")# Test the connectiontry: client.ping() print("✓ Connected to Acontext successfully!")except Exception as e: print(f"✗ Connection failed: {e}")
Copy
import { AcontextClient } from '@acontext/acontext';// Initialize the clientconst client = new AcontextClient({ apiKey: 'sk-ac-your-root-api-bearer-token', baseUrl: 'http://localhost:8029/api/v1'});// Test the connectiontry { await client.ping(); console.log('✓ Connected to Acontext successfully!');} catch (error) { console.error('✗ Connection failed:', error);}
If you see the success message, you’re ready to start using Acontext!