
Real-time sync for Postgres.

Sync is the magic ingredient behind fast, modern software. From apps like Figma and Linear to AI agents running on live local data.
Electric is a Postgres sync engine. It solves the hard problems of sync for you, including partial replication, fan-out, and data delivery. So you can build awesome software, without rolling your own sync.
Specifically, Electric is a read-path sync engine for Postgres. It syncs data out of Postgres into ... anything you like. The core sync protocol is based on a low-level HTTP API. This integrates with CDNs for highly-scalable data delivery.
Partial replication is managed using Shapes. Sync can be consumed directly or via client libraries and framework integrations.
You should have a PostgreSQL instance running. Deploy one here.
You also need to add wal_level = 'logical' to your postgresql.conf file. You can find it on your PostgreSQL Config Editor page.
Once you have a PostgreSQL instance, you can deploy Electric by clicking the "Deploy" button. This one-click deployment template will automatically associate with the first PostgreSQL instance in your project.
Note that this API is protected with an API token. You can find the default token in the "Instructions" section of the electric service. Feel free to change the PASSWORD environment variable to a custom value to rotate your token.
We have also set up a cache proxy on the Electric service. It is recommended to use our proxy to access the Electric service, which is the domain you bound when deploying the service. You can find the proxy domain in the "Instructions" section of the electricproxy service.
In production, you may also need to set up an auth proxy to prevent unauthorized access. You can use the BFF (e.g., API routes) provided by Next.js or TanStack Start to proxy it.
Once you have deployed the Electric service, you can use the following API to request a Shape containing all rows in the scores table:
curl https://your-domain.zeabur.app/v1/shape?table=scores&offset=-1&secret=SECRET_FROM_INSTRUCTIONS
DATABASE_URL: The URL of the PostgreSQL instance. This is useful if you have more than one PostgreSQL instance running.PASSWORD: The API token for the Electric service. You can also find it in the "Instructions" section of the electric service.