discord-xsp
v1.0.1
Published
Discord X-Super-Properties header generator.
Readme
discord-xsp
Discord X-Super-Properties header generator for HTTP requests & WebSocket connections.
Generates realistic x-super-properties headers that match Discord's official clients across all platforms.
Features
- Web client - Full support with automatic Chrome version detection
- Android client - Full support with automatic version fetching
- Desktop client - Full support with Electron version detection
- iOS client - Partial support (requires manual version info)
- HTTP & WebSocket - Both request types supported
- Auto-versioning - Fetches latest build numbers automatically
- Launch signatures - Generates valid signatures per client type
Installation
npm install discord-xspQuick Start
import { SuperProps, Client, Platform } from 'discord-xsp';
const props = new SuperProps('your-installation-id');
props
.setClient(Client.Desktop)
.setPlatform(Platform.Windows)
.setChannel('stable');
const xSuperProperties = (await props.generate()).toString();
// Use as header: { 'x-super-properties': xSuperProperties }API
Constructor
new SuperProps(installationId: string | null, deviceVendorId?: string)| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| installationId | string \| null | Yes | Unique installation identifier. Store this per account to avoid flagging. |
| deviceVendorId | string | No | Device vendor ID for mobile clients. Required for iOS/Android to prevent account flagging. |
Methods
All setter methods return this for chaining.
| Method | Description |
|--------|-------------|
| setClient(client) | Set client type: Client.Web, Client.Desktop, Client.Android, Client.IOS |
| setPlatform(platform) | Set platform: Platform.Windows, Platform.MacOS, Platform.Linux, Platform.Android, Platform.IOS |
| setArchitecture(arch) | Set architecture: Architecture.X86, Architecture.X64, Architecture.ARM, Architecture.ARM64 |
| setChannel(channel) | Set release channel: 'stable', 'canary', 'ptb' |
| setLocale(locale) | Set system locale (default: 'en-US') |
| setInstallationId(id) | Update installation ID |
| setIsOverWs(isOverWs) | Enable WebSocket-specific properties |
| setOsVersion(version) | Set OS version string |
| setDistro(distro) | Set Linux distribution name (desktop only) |
| setWindowManager(wm) | Set window manager (desktop only) |
| setOsSdkVersion(sdk) | Set OS SDK version (mobile only) |
| setVersionInfo(version) | Set version info for iOS: { buildNumber: number, versionCode: string } |
| setOverrides(overrides) | Override any generated property |
| generate() | Generate properties (async). Regenerates heartbeat UUID if 30+ minutes passed. |
| toJSON() | Get properties as JSON object |
| toString() | Get properties as base64-encoded string |
Enums
enum Client {
Web = 'discord_web',
Desktop = 'discord_desktop',
IOS = 'discord_ios',
Android = 'discord_android',
}
enum Platform {
Windows = 'win',
MacOS = 'osx',
Linux = 'linux',
Android = 'android',
IOS = 'iOS',
}
enum Architecture {
X86 = 'x86',
X64 = 'x64',
ARM = 'arm',
ARM64 = 'arm64',
}Examples
Web Client (HTTP)
import { SuperProps, Client, Platform } from 'discord-xsp';
const props = new SuperProps('my-installation-id');
props
.setClient(Client.Web)
.setPlatform(Platform.Windows)
.setChannel('canary');
const result = await props.generate();
// JSON for x-super-properties header
console.log(result.toJSON());
// Base64 string for header value
console.log(result.toString());Desktop Client
import { SuperProps, Client, Platform } from 'discord-xsp';
const props = new SuperProps('my-installation-id');
props
.setClient(Client.Desktop)
.setPlatform(Platform.Linux)
.setChannel('stable')
.setDistro('ubuntu')
.setWindowManager('gnome');
const result = await props.generate();
console.log(result.toJSON());Android Client
import { SuperProps, Client, Platform } from 'discord-xsp';
const deviceVendorId = crypto.randomUUID().toUpperCase();
const props = new SuperProps('my-installation-id', deviceVendorId);
props
.setClient(Client.Android)
.setChannel('stable');
const result = await props.generate();
console.log(result.toJSON());iOS Client
import { SuperProps, Client } from 'discord-xsp';
const deviceVendorId = crypto.randomUUID().toUpperCase();
const props = new SuperProps(null, deviceVendorId);
props
.setClient(Client.IOS)
.setVersionInfo({ buildNumber: 105281, versionCode: '337.0' })
.setIsOverWs(true);
const result = await props.generate();
console.log(result.toJSON());WebSocket Connection
const props = new SuperProps('my-installation-id');
props
.setClient(Client.Web)
.setIsOverWs(true); // Enables WebSocket-specific fields
const result = await props.generate();
// Includes: installation_id, is_fast_connectGenerated Fields
Common Fields (all clients)
| Field | Description |
|-------|-------------|
| os | Operating system name |
| browser | Client browser identifier |
| release_channel | Release channel |
| browser_user_agent | Full user agent string |
| browser_version | Browser/Chrome version |
| client_build_number | Build number |
| system_locale | System locale |
| has_client_mods | Client modifications flag |
| os_version | OS version |
| client_launch_id | Launch UUID |
| launch_signature | Generated launch signature |
| client_heartbeat_session_id | Heartbeat session UUID |
| client_app_state | Always 'focused' |
Web-Specific Fields
| Field | Description |
|-------|-------------|
| device | Device identifier |
| referrer | Referrer URL |
| referring_domain | Referring domain |
| referrer_current | Current referrer |
| referring_domain_current | Current referring domain |
| search_engine_current | Search engine |
| mp_keyword_current | Keyword (default: 'discord') |
Desktop-Specific Fields
| Field | Description |
|-------|-------------|
| client_version | Desktop client version |
| os_arch | OS architecture |
| app_arch | Application architecture |
| native_build_number | Native build number |
| os_sdk_version | OS SDK version |
| window_manager | Window manager (optional) |
| distro | Linux distribution (optional) |
Mobile-Specific Fields
| Field | Description |
|-------|-------------|
| device | Device model |
| device_vendor_id | Device vendor UUID |
| design_id | Design identifier |
| client_version | Client version string |
WebSocket-Specific Fields
| Field | Description |
|-------|-------------|
| installation_id | Installation ID (only when isOverWs=true) |
| is_fast_connect | Always false (only when isOverWs=true) |
Version Fetching
The library automatically fetches latest versions from:
- Web:
discord.com/app(build number + commit hash) - Android:
discord-versions.pages.dev - Desktop:
updates.discord.com+ Electron version from GitHub - Chrome:
googlechromelabs.github.io/chrome-for-testing
Notes
installationIdshould be stored per account - reusing across accounts may trigger flaggingdeviceVendorIdis required for mobile clients to prevent account theft detection- Heartbeat session ID regenerates every 30 minutes automatically
- iOS requires manual version info via
setVersionInfo()(auto-fetch not yet implemented) - Launch signatures differ between mobile (nanosecond timestamp) and desktop/web (128-bit UUID with bit masking)
