A TypeScript, Node.js and Browser(JavaScript) compatible client for Mixer.com's interactive 2 Protocol.
For an introduction to interactive2 checkout the reference docs on the developers site.
You can use npm(recommended) or download a zip from the releases page.
<script src="dist/interactive.js"></script>
npm i --save @mixer/interactive-node
OAuth 2.0 is used for authentication. Valid bearer tokens can be passed in the Client.open method.
For more information about Mixer's OAuth visit the OAuth reference page on our developer site.
<doctype html>
<html>
<head>
<title>Interactive 2</title>
</head>
<body>
<script src="js/interactive.js"></script>
<script src="js/app.js"></script>
</body>
</html>
const client = new interactive.GameClient();
client.open({
authToken: '<OAuth Token>',
versionId: 1234,
});
const interactive = require('@mixer/interactive-node');
const ws = require('ws');
interactive.setWebSocket(ws);
const client = new interactive.GameClient();
client.open({
authToken: '<OAuth Token>',
versionId: 1234,
});
import { GameClient, setWebSocket } from '@mixer/interactive-node';
import * as ws from 'ws';
setWebSocket(ws);
const client = new GameClient();
client.open({
authToken: '<OAuth Token>',
versionId: 1234,
});
Checkout our examples to get up to speed quickly!
- basic - Connects and sets up 5 buttons, when they are clicked the participant is charged 1 spark.
- dynamicControls - Connects and then creates and destroys 5 buttons with random text.
- joystick - Connects and creates a joystick, logs participant coordinate values.
Using Node.js? Clone this repository and run npm run build
and the examples will be converted to JavaScript for you!
Checkout our reference docs here.
To get a development environment setup:
- Clone this repository
npm install
npm run build
Thanks for your interested in contributing, checkout TODO.md for a list of tasks!
Open a Pull Request we'd love to see your contributions.