SDK for Node.js and Python
Call the API with full types: paths, parameters and responses autocomplete in your editor. The SDK is generated automatically from this portal's OpenAPI document, so it always matches the live API.
| Language | Package | Install | Version |
|---|---|---|---|
| Node.js / TypeScript | @nextxai/sdk | npm install @nextxai/sdk | 0.1.1 |
| Python | nextx-sdk | pip install nextx-sdk | 0.1.1 |
Node.js / TypeScript
Version 0.1.1 · Package page · Source
Install
npm install @nextxai/sdkCall with an API key
import { createNextXClient, SANDBOX_URL } from "@nextxai/sdk";
const nx = createNextXClient({ apiKey: process.env.NEXTX_API_KEY!, baseUrl: SANDBOX_URL });
const { data, error } = await nx.GET("/api/v1/crm/contacts", {
params: { query: { pageSize: 20 } },
});
if (error) throw new Error(`${error.status} ${error.title}`);OAuth apps: pass an access token (or a function that returns a fresh token for every call)
const nx = createNextXClient({ accessToken: () => tokenStore.current() });Python
Version 0.1.1 · Package page · Source
Install
pip install nextx-sdkCall with an API key
import os
from nextx_sdk import create_client, SANDBOX_URL
from nextx_sdk.api.crm import contacts_list
nx = create_client(api_key=os.environ["NEXTX_API_KEY"], base_url=SANDBOX_URL) # production: PROD_URL (https://api.nextx.vn)
page = contacts_list.sync(client=nx, page_size=20)Each operation is a module in nextx_sdk.api.<module>: .sync() returns data, .sync_detailed() adds the status code, .asyncio() for async code.
Notes
- API keys go in the
X-Api-Keyheader; OAuth access tokens inAuthorization: Bearer. The SDK sets the right header. - Production is the default. For testing use the sandbox with a sandbox key — sandbox keys cannot call production and vice versa.
- Versions follow
Semantic Versioning, independent of the API version: the bump is decided by diffing the old and new OpenAPI; breaking changes require human review. See VERSIONING.md in the source repository. - Previews tracking the sandbox API:
npm i @nextxai/sdk@beta·pip install --pre nextx-sdk— may change at any time. - Other languages: download
openapi.jsonand generate a client with your usual OpenAPI tooling.