npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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-xsp

Quick 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_connect

Generated 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

  • installationId should be stored per account - reusing across accounts may trigger flagging
  • deviceVendorId is 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)