# Installation — SDK, CLI, and Gateway Binary > Install @rep-protocol/sdk, framework adapters for React/Vue/Svelte, the CLI tool, and the Go gateway binary. npm packages and Docker image options. Source: https://rep-protocol.dev/guides/installation/ ## SDK The SDK is the only package required for your application code. Zero runtime dependencies, ~1.5KB gzipped. ```bash npm install @rep-protocol/sdk ``` ## Framework adapters (optional) If you're using React, Vue, or Svelte, install the corresponding adapter for hot-reload-aware hooks and stores: **React** ```bash npm install @rep-protocol/react @rep-protocol/sdk ``` **Vue** ```bash npm install @rep-protocol/vue @rep-protocol/sdk ``` **Svelte** ```bash npm install @rep-protocol/svelte @rep-protocol/sdk ``` ## Build-tool plugins (optional) 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: **Vite** ```bash npm install -D @rep-protocol/vite ``` ```ts // 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](/reference/plugins/vite/) for all options. **Next.js** ```bash npm install -D @rep-protocol/next ``` ```tsx // app/layout.tsx import type { ReactNode } from 'react'; import { RepScript } from '@rep-protocol/next'; export default function RootLayout({ children }: { children: ReactNode }) { return ( {children} ); } ``` ```ts // app/api/rep/session-key/route.ts (only needed for SENSITIVE vars) export { GET } from '@rep-protocol/next/session-key'; ``` `RepScript` renders the REP payload during `next dev` and returns `null` in production — the gateway handles injection in prod. See the [Next.js plugin reference](/reference/plugins/next/) for all options. > **Note** > > Build-tool plugins are for **development only**. In production, the Go gateway injects the payload. The plugins produce byte-identical output to the gateway, so the SDK works identically in both environments. ## CLI 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. ```bash npm install -g @rep-protocol/cli ``` Or use without installing: ```bash npx @rep-protocol/cli validate npx @rep-protocol/cli dev --proxy http://localhost:5173 ``` ## Gateway binary The gateway is a standalone Go binary (~7MB). There are several ways to get it: ### Via the CLI (recommended) The `@rep-protocol/cli` package downloads the gateway binary automatically during `npm install`. ### Docker image ```bash docker pull ghcr.io/ruachtech/rep/gateway:latest ``` Or use in a multi-stage build: ```dockerfile COPY --from=ghcr.io/ruachtech/rep/gateway:latest /usr/local/bin/rep-gateway /usr/local/bin/rep-gateway ``` ### Direct download Download from [GitHub Releases](https://github.com/ruachtech/rep/releases) for your platform: Archives are published on the version tag — `v0.1.7`, not `gateway/v0.1.7`: ```bash # 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: ```bash 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. ### Build from source Requires Go >= 1.24.5: ```bash cd gateway make build # Binary at gateway/bin/rep-gateway ``` ## Development prerequisites For contributing to REP itself: | Tool | Version | Purpose | |---|---|---| | Node.js | >= 20.0.0 | TypeScript packages | | pnpm | >= 9.0.0 | Workspace management | | Go | >= 1.24.5 | Gateway development | ```bash git clone https://github.com/ruachtech/rep.git cd rep pnpm install pnpm run build ```