XSplit JS Framework (XJS)
raw JSON →The XSplit JS Framework, distributed as `xjs-framework`, was designed to empower developers to create plugins for XSplit Broadcaster, facilitating rapid integration and interaction with the XSplit environment. Its primary utility revolved around providing an API and structure for building interactive components within the broadcasting software. The package's current stable version on npm is 2.10.2, which was last published approximately five years ago. Despite the listing of more recent 'releases' up to 2.9.0 in some contexts, the public npm package and the primary GitHub repository indicate a lack of active maintenance and new releases since early 2019. This framework differentiates itself by being purpose-built for the XSplit ecosystem, offering tools tailored to that specific plugin development environment, rather than being a general-purpose web framework.
Common errors
error ReferenceError: require is not defined ↓
const XJS = require('xjs-framework'); to import * as XJS from 'xjs-framework';. If in a browser context, ensure proper bundling and module loading or check if xjs-framework was meant for a Node.js-like runtime provided by XSplit. error TypeError: Cannot read properties of undefined (reading 'onReady') ↓
Warnings
breaking The `xjs-framework` package has not seen a new public npm release in approximately five years (since version 2.10.2 in early 2019). This indicates the project is no longer actively maintained for new features or bug fixes, making it potentially incompatible with newer Node.js versions, XSplit Broadcaster releases, or modern web standards. ↓
gotcha Despite 'recent releases' mentioned in older documentation or internal wikis, the official npm package `xjs-framework` remains at version 2.10.2, published 5 years ago. This discrepancy can lead to confusion about the project's maintenance status and available features. ↓
gotcha Given its age, `xjs-framework` may primarily rely on or expect CommonJS (CJS) module patterns, especially within the XSplit plugin runtime environment. Attempting to use pure ES Modules (ESM) features without proper transpilation or configuration might lead to module resolution errors. ↓
Install
npm install xjs-framework yarn add xjs-framework pnpm add xjs-framework Imports
- XJS wrong
const XJS = require('xjs-framework');correctimport * as XJS from 'xjs-framework'; - PluginHost
import { PluginHost } from 'xjs-framework'; - XJSPlugin
import type { XJSPlugin } from 'xjs-framework';
Quickstart
import { PluginHost } from 'xjs-framework';
interface MyPluginSettings {
message: string;
count: number;
}
async function initializePlugin() {
console.log('XJS Plugin initializing...');
// Simulate connection to XSplit Plugin Host
const host = new PluginHost(); // Hypothetical initialization
host.onReady(() => {
console.log('PluginHost is ready!');
// Example: Registering a simple command
host.registerCommand('sayHello', (args: { name: string }) => {
const greeting = `Hello, ${args.name || 'XSplit User'} from XJS Plugin!`;
console.log(greeting);
host.sendMessageToUI('logMessage', greeting);
});
// Example: Getting and setting settings (hypothetical)
host.getSettings<MyPluginSettings>().then(settings => {
console.log('Current settings:', settings);
if (!settings.message) {
host.setSettings({ message: 'Default XJS message', count: 0 });
}
});
host.log('XJS Plugin loaded successfully!');
host.sendMessageToUI('pluginLoaded', { success: true });
});
host.onError((error: Error) => {
console.error('XJS Plugin Host error:', error);
host.sendMessageToUI('pluginError', { message: error.message });
});
host.connect(); // Start the connection (hypothetical)
}
initializePlugin().catch(console.error);