Skip to content

Installation — SDK, CLI, and Gateway Binary

The SDK is the only package required for your application code. Zero runtime dependencies, ~1.5KB gzipped.

Terminal window
npm install @rep-protocol/sdk

If you’re using React, Vue, or Svelte, install the corresponding adapter for hot-reload-aware hooks and stores:

Terminal window
npm install @rep-protocol/react @rep-protocol/sdk

For the best dev experience, install the plugin for your build tool. These inject the REP payload during development so the SDK works without running the Go gateway:

Terminal window
npm install -D @rep-protocol/vite
vite.config.ts
import { defineConfig } from 'vite';
import { repPlugin } from '@rep-protocol/vite';
export default defineConfig({
plugins: [repPlugin()],
});

That’s it — rep.get() and rep.getSecure() now work in vite dev. No gateway needed. See the Vite plugin reference for all options.

The CLI provides rep validate, rep typegen, rep lint, and rep dev commands. It automatically downloads the correct gateway binary for your platform during installation.

Terminal window
npm install -g @rep-protocol/cli

Or use without installing:

Terminal window
npx @rep-protocol/cli validate
npx @rep-protocol/cli dev --proxy http://localhost:5173

The gateway is a standalone Go binary (~7MB). There are several ways to get it:

The @rep-protocol/cli package downloads the gateway binary automatically during npm install.

Terminal window
docker pull ghcr.io/ruachtech/rep/gateway:latest

Or use in a multi-stage build:

COPY --from=ghcr.io/ruachtech/rep/gateway:latest /usr/local/bin/rep-gateway /usr/local/bin/rep-gateway

Download from GitHub Releases for your platform:

Archives are published on the version tag — v0.1.7, not gateway/v0.1.7:

Terminal window
# Linux amd64
curl -fsSL https://github.com/RuachTech/rep/releases/download/v0.1.7/rep-gateway_0.1.7_linux_amd64.tar.gz | tar -xz
mv rep-gateway /usr/local/bin/
# macOS arm64
curl -fsSL https://github.com/RuachTech/rep/releases/download/v0.1.7/rep-gateway_0.1.7_darwin_arm64.tar.gz | tar -xz
mv rep-gateway /usr/local/bin/

To always fetch the newest release instead of a pinned version:

Terminal window
VERSION=$(curl -fsSL https://api.github.com/repos/RuachTech/rep/releases/latest | grep -m1 '"tag_name"' | cut -d'"' -f4)
curl -fsSL "https://github.com/RuachTech/rep/releases/download/${VERSION}/rep-gateway_${VERSION#v}_linux_amd64.tar.gz" | tar -xz
mv rep-gateway /usr/local/bin/

Each release also ships a checksums.txt for verification.

Requires Go >= 1.24.5:

Terminal window
cd gateway
make build
# Binary at gateway/bin/rep-gateway

For contributing to REP itself:

ToolVersionPurpose
Node.js>= 20.0.0TypeScript packages
pnpm>= 9.0.0Workspace management
Go>= 1.24.5Gateway development
Terminal window
git clone https://github.com/ruachtech/rep.git
cd rep
pnpm install
pnpm run build