Verified against the current implementation
01
Current SDK support
No separate official npm or PyPI package is published in the current release. The APIs use HTTP and JSON and work with the standard tools in each language.
Do not install similarly named Tusi packages from untrusted sources. Official packages will be listed here after release.
02
TypeScript
A small wrapper centralizes status handling and response contracts.
typescriptTusi
type ApiResponse<T> =
| { status: "success"; data: T }
| { status: "error"; message: string }
export async function getHealth() {
const response = await fetch("https://tusihub.ir/api/health")
if (!response.ok) throw new Error(`Health check failed: ${response.status}`)
return response.json()
}03
Python
A health check needs no third-party dependency; the standard urllib module is sufficient.
pythonTusi
import json
from urllib.request import Request, urlopen
request = Request(
"https://tusihub.ir/api/health",
headers={"Accept": "application/json"},
)
with urlopen(request, timeout=10) as response:
payload = json.load(response)
print(payload["status"])04
Stable client rules
Keep your wrapper small, testable, and independent from UI code.
- Set a timeout for every network call
- Validate responses against a schema before use
- Keep credentials in server environments only
- Log failures without sensitive payloads
Did this guide miss your question?
Send your technical context to our team and we will help identify the right path.