Skip to main content

SDK Overview

The Taruvi SDK provides official client libraries for Python and JavaScript/TypeScript. Build applications faster with type-safe, developer-friendly APIs that handle authentication, data management, storage, functions, and more.


Available SDKs

LanguagePackageVersionDocumentation
Pythontaruvi0.1.6PyPI
JavaScript/TypeScript@taruvi/sdk1.2.0npm

Installation

pip install taruvi

Requirements: Python 3.10 or higher


Quick Example

from taruvi import Client

# Initialize client (api_url and app_slug are required)
client = Client(
api_url="https://api.taruvi.cloud",
app_slug="my-app"
)

# Authenticate (returns a NEW client instance — immutable pattern)
auth_client = client.auth.signInWithPassword(
username="alice@example.com",
password="secret123"
)

# Query database (returns {"data": [...], "total": N})
result = auth_client.database.from_("users").filter("status", "eq", "active").execute()
users = result["data"]

# Upload file
auth_client.storage.from_("documents").upload(
files=[("report.pdf", open("report.pdf", "rb"))],
paths=["uploads/report.pdf"]
)

# Execute function
result = auth_client.functions.execute("send-email", params={"user_id": 123})

# Manage users
user = auth_client.users.get("alice")

# Check authorization policies
allowed = auth_client.policy.get_allowed_actions(
{"kind": "datatable", "id": "orders"}
)

# Execute analytics queries
stats = auth_client.analytics.execute("monthly-revenue", params={"year": "2024"})

# Get app settings and roles
settings = auth_client.app.settings()
roles = auth_client.app.roles()

Why Use the SDK?

  • Type-Safe: Full TypeScript and Python type hints for IDE autocomplete
  • Auto Authentication: Handles JWT tokens, API keys, session tokens, and username/password login
  • Error Handling: Comprehensive exception hierarchy with clear messages
  • Performance: Connection pooling, automatic retries, efficient HTTP clients (httpx)
  • Sync & Async: Native sync (default) and async modes — no asyncio.run() wrappers
  • Consistent APIs: Clean, intuitive interfaces across all modules

Available Modules (Python)

ModuleAccessDescription
databaseclient.databaseQuery builder, CRUD, edges, aggregations, graph traversal
functionsclient.functionsExecute functions, async execution, get results
storageclient.storageFile upload/download, bucket management, copy/move
authclient.authSign in/out, token management, current user
usersclient.usersUser CRUD, role assignment/revocation
secretsclient.secretsSecret retrieval, batch get, filtered listing
policyclient.policyCerbos authorization checks, filter allowed resources
analyticsclient.analyticsExecute analytics queries
appclient.appApp roles and settings
settingsclient.settingsSite metadata

Next Steps

📦 Installation Guide

Detailed setup instructions and environment configuration.

Installation Guide →

⚡ Quickstart Tutorial

Build your first application in 5 minutes.

Quickstart Guide →

🔐 Authentication

Learn about authentication methods and patterns.

Authentication Guide →

📚 API Reference

Explore detailed API documentation with code examples.

API Reference →


Community & Support