Centrali Documentation¶
Welcome to Centrali - your Backend-as-a-Service platform for building modern web applications!
What is Centrali?¶
Centrali provides everything you need to build web applications without managing infrastructure:
- Data Management - Define schemas and store records with automatic validation
- Serverless Functions - Write JavaScript that runs in the cloud
- File Storage - Upload and manage files with CDN delivery
- Full-Text Search - Instant search across all your data
- Automation - Triggers and webhooks for event-driven workflows
- Real-time Updates - WebSocket notifications for live data
Quick Start¶
Get started in minutes:
- Account Setup - Create your account and get credentials
- Introduction - Understand what Centrali can do
- Quick Start Guide - Build your first API in 10 minutes
- Your Workspace - Understand your Centrali environment
Core Features¶
Data Management¶
- Structures & Records - Your data schemas and entries
- Query Language - Powerful data querying
- Query Examples - Common query patterns
Compute & Automation¶
- Compute Functions - Serverless business logic
- Writing Functions - Complete function guide
- Function Reference - API reference for functions
- Webhooks - Real-time event notifications
Storage & Search¶
- File Storage - Upload and manage files
- Search Engine - Full-text search capabilities
Additional Features¶
- Notifications - Email and push notifications
- Access Control - Authentication and permissions
SDKs & Tools¶
Build faster with our official SDKs:
JavaScript/TypeScript SDK¶
Install and start building in seconds:
import { CentraliSDK } from '@centrali-io/centrali-sdk';
// Initialize with service account credentials
const centrali = new CentraliSDK({
baseUrl: 'https://api.centrali.io',
workspaceId: 'your-workspace',
clientId: process.env.CENTRALI_CLIENT_ID,
clientSecret: process.env.CENTRALI_CLIENT_SECRET
});
// Create records with one line
const product = await centrali.createRecord('Product', {
name: 'Awesome Product',
price: 99.99
});
// Invoke functions easily
const result = await centrali.invokeFunction('calculate-discount', {
productId: product.id,
couponCode: 'SAVE20'
});
Learn more about the JavaScript SDK →
New to Centrali? Start with the Account Setup Guide to get your service account credentials.
API Reference¶
Complete API documentation:
- API Overview - All endpoints at a glance
- Authentication Overview - How authentication works
- Service Account API - API authentication reference
- Structures API - Schema management
- Records API - Data operations
- Compute Functions API - Function management
- Function Triggers API - Automation setup
- Limits & Quotas - Rate limits and platform constraints
Examples & Tutorials¶
Learn by building real applications:
- Blog Platform - Complete blog with comments and moderation
- E-commerce API - Product catalog and order management
Common Use Cases¶
Building a SaaS Application¶
- Define user and subscription structures
- Implement authentication with service accounts
- Create compute functions for business logic
- Set up webhooks for payment processing
Creating a Content Management System¶
- Design content structures (posts, pages, media)
- Implement CRUD operations via Records API
- Add search functionality
- Build moderation workflows with functions
Mobile App Backend¶
- Set up user authentication
- Create data structures for app content
- Implement push notifications
- Handle file uploads for user content
Quick Code Examples¶
Create a Record¶
// First, get a token from your service account credentials
// See: https://centrali.io/docs/guides/authentication-overview
const response = await fetch('https://api.centrali.io/data/workspace/your-workspace/api/v1/records', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
structureId: 'str_products',
data: {
name: 'Amazing Widget',
price: 99.99,
inStock: true
}
})
});
Write a Function¶
exports.handler = async (event, context) => {
const { centrali } = context.apis;
// Process the incoming data
const result = await centrali.records.create({
structure: 'Orders',
data: event.data
});
return {
success: true,
data: result
};
};
Query Data¶
const query = `
FROM Product
WHERE price < 100 AND inStock = true
ORDER BY createdAt DESC
LIMIT 10
`;
const results = await centrali.query(query);
Getting Help¶
- Getting Started? Follow the Account Setup Guide
- Authentication Issues? See Troubleshooting: Authentication
- Error Responses? Check the Error Handling Guide
- Rate Limits? Review Limits & Quotas
- Common Problems? Browse the Troubleshooting Guide
- API Reference? See API Overview
- Function Problems? Read Writing Functions Guide
- Query Help? Check the Query Guide
Ready to Build?¶
Start with our Quick Start Guide and build your first Centrali application today!
Documentation Version 2.0 - Focused on building applications, not infrastructure