Skip to main content
Scramjet uses a comprehensive configuration system to control behavior, feature flags, and URL encoding.

ScramjetInitConfig

The configuration interface for initializing Scramjet.

Properties

string
required
The URL prefix for proxied content. Default: /scramjet/
object
required
Global variable names used by Scramjet’s runtime.
object
required
Paths to Scramjet bundle files.
Partial<ScramjetFlags>
required
Feature flags to enable or disable Scramjet features. See ScramjetFlags below.
Record<string, Partial<ScramjetFlags>>
Per-site feature flag overrides. Keys are hostnames or URLs.
object
required
URL encoding and decoding functions.

Example

ScramjetConfig

The internal configuration interface (extends ScramjetInitConfig with normalized types).
ScramjetConfig is the same as ScramjetInitConfig, except the codec functions are serialized as strings and flags is complete (not partial).

ScramjetFlags

Feature flags that control Scramjet’s behavior.

Properties

boolean
Enable service worker support. Default: false
Enabling this may cause compatibility issues with some sites.
boolean
Enable synchronous XMLHttpRequest support. Default: false
boolean
Enable strict URL rewriting. Default: true
When enabled, invalid URLs will throw errors instead of being silently ignored.
boolean
Enable verbose rewriter logging. Default: false
boolean
Capture and handle errors from proxified code. Default: true
boolean
Clean Scramjet internals from error stack traces. Default: false
boolean
Enable scramitization feature. Default: false
boolean
Enable source map support. Default: true
boolean
Enable destructuring in rewrites. Default: false
boolean
Intercept and emit events for downloads. Default: false
boolean
Allow invalid JavaScript to pass through. Default: true
boolean
Allow failed intercepts without throwing errors. Default: true

Example

ScramjetVersionInfo

Version information for the current Scramjet build.

Example