Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Installation

Install Ablo, declare the models participants share, and create a typed client.

Start from your PostgreSQL database in the dashboard, or install the TypeScript SDK in an existing or new project.

Start with the HTTP API

For Go, Python, or another HTTP client, sign up and open Connect database in your project. New workspaces open this setup automatically.

  1. Connect a network-reachable PostgreSQL database and select its tables.
  2. Confirm whether the connected workspace owns every row or rows carry an Ablo organisation ID in a tenant column.
  3. Review and apply the scoped access setup and generated JSON contract.
  4. Save the API key, copy the curl or Go example, and verify the first request.

Automatic setup uses your owner credential temporarily. Ongoing access uses a separate scoped reader and writer; your migrations stay under your control. Logical replication must already be enabled. The setup checks supported column types and a unique, non-null text or UUID id before activating a model.

Choose Manual setup to generate the SQL and run it with your own database administrator. Ablo then verifies the scoped credentials you provide. If database credentials must stay in your infrastructure, use a signed Data Source; arbitrary direct SQL writes require their own authoritative change feed in that mode.

This path generates the contract from PostgreSQL and needs no npm installation or TypeScript file. Continue with the HTTP API reference.

Install the package

npm install @abloatai/ablo
npx ablo init

ablo init creates the schema, registration, and client files and signs the developer in. Keep these files together under one ablo/ ownership boundary.

Declare shared models

Declare only the rows Ablo coordinates. Your other tables stay in the schema and migrations the application already owns.

// ablo/schema.ts
import { defineSchema, model, z } from '@abloatai/ablo/schema';

export const schema = defineSchema({
  tasks: model({
    title: z.string(),
    status: z.enum(['open', 'done']),
  }),
});

Every model automatically has an id. Declare application fields such as timestamps and actor ids yourself when you need them.

Start development

npx ablo dev

The development command prepares an isolated Ablo branch, supplies its temporary ABLO_API_KEY, pushes the schema, and watches for changes. Runtime code always reads ABLO_API_KEY; do not put management credentials in the application.

Use your PostgreSQL database

npx ablo connect

Ablo runs no DDL and does not replace your migration tool. It writes the models you declared and confirms changes from PostgreSQL’s write-ahead log. Existing APIs, direct SQL, constraints, and transactions can remain in place.

Create the client

ablo init scaffolds this file. Start with the HTTP client for an agent or server operation; it has no persistent connection to manage.

// ablo/client.ts
import Ablo from '@abloatai/ablo';
import { schema } from './schema';

export const ablo = Ablo({
  schema,
  apiKey: process.env.ABLO_API_KEY,
  transport: 'http',
});

Continue to Basic usage to read, write, and coordinate one operation. Use the full Quickstart when you need the detailed branch, schema-registration, and database setup explanation.

Was this page helpful?