Installation

Install the Pushrift SDK into your Electron app and the CLI into your development environment.

Prerequisites

  • Node.js 18 or later
  • Electron 28 or later (earlier versions may work but are untested)
  • A Pushrift account and an app created in the dashboard

SDK

The @pushrift/sdk package runs in your Electron main process. It checks for live updates on launch, downloads any available bundle, and returns the correct file path for your renderer window to load.

npm install @pushrift/sdk

Basic setup

Open your Electron main.js (or main.ts) and add the following before you create your BrowserWindow:

import { Pushrift } from '@pushrift/sdk'
import path from 'path'

const pushrift = new Pushrift({
  appId: 'YOUR_APP_ID',
  appBundlePath: path.join(__dirname, '..', 'renderer'),
})

app.whenReady().then(async () => {
  const win = new BrowserWindow({ /* your options */ })

  // Use getFilePath() so the window loads the live-updated bundle when available
  win.loadFile(pushrift.getFilePath())
})

Replace YOUR_APP_ID with the UUID from your app's settings page in the Pushrift dashboard.

getFilePath() returns the path to the active renderer entry point. When a live update has been applied, it points to the downloaded bundle instead of the bundled default. Always use it instead of a hardcoded path.

Configuration reference

OptionTypeRequiredDescription
appIdstringYesUUID of your app in the Pushrift dashboard
appBundlePathstringYesAbsolute path to your renderer's directory (the folder containing index.html)
appVersionstringNoDefaults to app.getVersion() from Electron

CLI

The @pushrift/cli package provides the pushrift deploy command. Install it globally or as a dev dependency in your project.

Coming soon — The CLI is under active development. This section will be updated when it is available.
# Global install (recommended for local development)
npm install -g @pushrift/cli

# Or as a dev dependency (recommended for CI)
npm install --save-dev @pushrift/cli

Authentication

Before deploying, authenticate the CLI with your Pushrift API key. You can generate an API key in the dashboard under API Keys.

pushrift auth login --key YOUR_API_KEY

Or set the PUSHRIFT_API_KEY environment variable directly — preferred for CI pipelines:

export PUSHRIFT_API_KEY=YOUR_API_KEY