Skip to content

lott-ai/electron-releases

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Next.js logo

Electron Releases

Self-hosted auto-update server for Electron apps

Serve Squirrel-compatible updates from your own infrastructure.
Modular adapters for any framework. Pluggable providers for any release source.


What is this?

Electron Releases is a toolkit for building auto-update servers for Electron applications. Instead of relying on third-party services, you can self-host your update infrastructure on your existing stack.

Key features:

  • πŸ”Œ Pluggable architecture β€” Mix and match adapters and providers
  • πŸš€ Framework-native β€” First-class adapters for Next.js, with more coming
  • πŸ”’ Private repo support β€” Serve updates from private GitHub repositories
  • πŸ“¦ Multi-channel releases β€” Support alpha, beta, and stable channels
  • πŸ–₯️ Cross-platform β€” macOS, Windows, and Linux support
  • ⚑ Squirrel-compatible β€” Works with Electron's built-in autoUpdater

Quick Start

Get up and running in under 5 minutes.

1. Install packages

npm install @electron-releases/adapter-nextjs @electron-releases/provider-github

2. Create an API route

// app/api/releases/[[...path]]/route.ts
import { configureNextjsAdapter } from "@electron-releases/adapter-nextjs";
import { configureGithubProvider } from "@electron-releases/provider-github";

const githubProvider = configureGithubProvider({
  token: process.env.GITHUB_TOKEN!,
  owner: "your-org",
  repo: "your-app",
});

export const GET = configureNextjsAdapter({
  releases: githubProvider.releases,
  assets: githubProvider.assets,
});

3. Configure your Electron app

import { autoUpdater } from "electron";

autoUpdater.setFeedURL({
  url: `https://your-domain.com/api/releases/update/darwin/${app.getVersion()}`,
});

autoUpdater.checkForUpdates();

That's it! Your Electron app now has self-hosted auto-updates.


How It Works

The system is built on two concepts: Adapters and Providers.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Electron App   │────▢│         Adapter           │────▢│        Provider           β”‚
β”‚   (Squirrel)    β”‚     β”‚  Next.js, Remix, Hono...  β”‚     β”‚  GitHub, GitLab, S3, R2   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚
                                     β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚           Core            β”‚
                        β”‚    Routing & Utilities    β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Adapters

Adapters integrate with your web framework to handle incoming requests. They translate framework-specific request/response patterns into the standard format used by the core router.

Package Description Version
@electron-releases/adapter-nextjs Next.js App Router adapter npm

Want an adapter for your framework? Open an issue or see Contributing.

Providers

Providers fetch release metadata and assets from your release source. They handle authentication, asset discovery, and URL signing for private releases.

Package Description Version
@electron-releases/provider-github GitHub Releases provider npm

Need a different provider? Open an issue to request support for GitLab, S3, or other sources.

Core

Core provides the routing logic, type definitions, and utilities shared by all adapters and providers.

Package Description Version
@electron-releases/core Core types, routing, and utilities npm

API Endpoints

All adapters expose the same set of endpoints:

Endpoint Description
GET / List releases. Use ?channel=beta to filter, ?all=true for all channels.
GET /download Auto-detect platform from User-Agent and redirect.
GET /download/:platform Download for a specific platform.
GET /update/:platform/:version Check for updates (Squirrel format).
GET /update/win32/:version/RELEASES Squirrel.Windows RELEASES file.

Supported Platforms

Platform Identifiers
macOS (Intel) darwin, mac, macos, osx
macOS (Apple Silicon) darwin_arm64, mac_arm64
Windows exe, win32, windows, win
Windows ARM exe_arm64, win32_arm64
Linux DEB deb, debian
Linux RPM rpm, fedora
Linux AppImage AppImage, appimage

Release Channels

Support multiple release channels for staged rollouts:

configureNextjsAdapter({
  channels: ["alpha", "beta", "stable"], // Last = default
  releases: githubProvider.releases,
  assets: githubProvider.assets,
});

Channel detection from versions:

  • 1.0.0 β†’ stable
  • 1.0.0-beta.1 β†’ beta
  • 1.0.0-alpha.3 β†’ alpha

Examples

Framework Description Link
Next.js Full Next.js App Router example examples/nextjs

Packages

Package Description README
@electron-releases/core Core interfaces, types, and routing README
@electron-releases/adapter-nextjs Next.js App Router adapter README
@electron-releases/provider-github GitHub Releases provider README

Contributing

We welcome contributions! Here's how you can help:

Report Issues

Found a bug or have a feature request? Open an issue.

Request New Adapters or Providers

Need support for a different framework or release source? Open an issue describing your use case:

  • Adapters: Express, Hono, Fastify, Cloudflare Workers, etc.
  • Providers: GitLab, S3, Azure Blob Storage, self-hosted, etc.

Build Your Own

The core package provides everything you need to build custom adapters and providers:

Development Setup

# Clone the repository
git clone https://github.com/lott-ai/electron-releases.git
cd electron-releases-adapter

# Install dependencies
bun install

# Build all packages
bun run build

# Run type checking
bun run typecheck

# Lint
bun run lint

Project Structure

β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ core/              # Core types, routing, utilities
β”‚   β”œβ”€β”€ adapter-nextjs/    # Next.js adapter
β”‚   └── provider-github/   # GitHub provider
β”œβ”€β”€ examples/
β”‚   └── nextjs/            # Example Next.js app
└── apps/
    β”œβ”€β”€ docs/              # Documentation site
    └── web/               # Marketing site

Requirements

  • Node.js 18+
  • For GitHub provider: GitHub Personal Access Token

License

MIT


Built with ❀️ for the Electron community

About

Toolkit for building self-hosted auto-update servers for Electron applications

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors