Skip to main content

Installation

Scramjet is available as an npm package and can be installed using your preferred package manager.

Requirements

Before installing Scramjet, make sure you have:
  • Node.js (recent version recommended)
  • A package manager: npm, yarn, or pnpm

Install the package

Package exports

Scramjet provides multiple export options depending on your use case:

Default export

This is a no-op export that won’t bundle Scramjet into your application.

Bundled export

Use this to include the full Scramjet bundle with all dependencies.

Path utilities

Provides utility functions for working with Scramjet paths and URLs.
For most use cases, you’ll want to load Scramjet via a script tag rather than bundling it directly. See the quickstart guide for the recommended setup.

Static files

After installation, you need to serve the Scramjet static files from your web server. These files are located in the dist directory of the package:
  • scramjet.bundle.js - Main Scramjet bundle
  • scramjet.all.js - All-in-one bundle for service workers
  • scramjet.sync.js - Synchronous XHR support
  • scramjet.wasm.wasm - WebAssembly rewriter module
Make sure these files are accessible from your web server at the paths you configure in your Scramjet initialization.

For development

If you want to build Scramjet from source for development purposes:
1

Clone the repository

2

Install dependencies

Scramjet development requires pnpm. The package includes a preinstall hook to enforce this.
3

Build the rewriter

This requires:
  • rustup
  • wasm-bindgen
  • Binaryen’s wasm-opt
  • The wasm-snip fork from r58Playz
4

Build Scramjet

5

Run the dev server

Scramjet will be running at http://localhost:1337 and will rebuild when files change.

Next steps

Now that you have Scramjet installed, follow the quickstart guide to set up your first proxy.