Install

There are two things to install to use ElectricSQL:

  1. the ElectricSQL client library for your target environment
  2. the ElectricSQL CLI tool

1. Install the client

The ElectricSQL client library electrifies your SQLite driver and manages auth and background replication. Currently there is one client library for Javascript-based mobile, web and edge applications.

Package

It’s published to the NPM package repository, so you can install using yarn:

yarn add electric-sql

Or using npm:

npm install electric-sql

Source

The Typescript client is developed at github.com/electric-sql/typescript-client.

2. Install the CLI

The ElectricSQL command line interface (CLI) tool is essential for building and bundling DDL migrations. It’s also useful for interacting with the ElectricSQL service, for example to create and manage applications.

Homebrew

If you’re on OSX, you can install using our Homebrew tap:

brew install electric-sql/tap/electric

Binaries

Alternatively, you can install pre-built binaries for your platform directly from the releases page.

Filenames follow the electricsql_cli_<VERSION>_<TARGET_ARCHITECTURE> pattern, such as electricsql_cli_v0.1.0_intel_mac). Download the file corresponding to your target architecture, set it to executable and put it on your path, e.g.:

curl <DOWNLOAD_URL> -o electric
chmod +x electric
mv electric /usr/local/bin
which electric
electric --help

Source

The CLI is developed in Elixir at github.com/electric-sql/cli. You can install from source and build a binary locally by following the instructions there.

Next step