Step 1: Create Your App
- Go to dashboard.onchaindb.io
- Create a new App to get your
appId - Navigate to the “Security” tab to generate your
appKey
Step 2: Install the SDK
Step 3: Initialize the Client
Step 4: Create Indexes
Creating indexes automatically creates the collections and sets up the data structure.Step 5: Store Data
Step 6: Query Data
That’s It!
You now have a fully functional onchain database with indexed queries, automatic transaction management, and blockchain-backed data storage.SDK Feature Comparison
| Feature | TypeScript | Go | PHP | Python |
|---|---|---|---|---|
| Query Builder | Yes | Yes | Yes | Yes |
| Server-side JOINs | Yes | Yes | Yes | Yes |
| Aggregations | Yes | Yes | Yes | Yes |
| Blob Storage | Yes | Yes | Yes | Yes |
| Auto-Pay (userKey) | Yes | Yes | Yes | Yes |
| Collection Schemas | Yes | Yes | Yes | Yes |
| Materialized Views | Yes | Yes | Yes | Yes |
| Task Polling | Yes | Yes | Yes | Yes |
| Context Support | N/A | Yes | N/A | N/A |