GithubHelp home page GithubHelp logo

ykankaya / interactive-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mixer/interactive-node

0.0 1.0 0.0 4.52 MB

A TypeScript, NodeJS and Browser compatible client for Mixer's interactive 2 Protocol.

License: MIT License

TypeScript 99.35% JavaScript 0.65%

interactive-node's Introduction

Interactive Node

Build Status

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.

Installation

You can use npm(recommended) or download a zip from the releases page.

Browser

<script src="dist/interactive.js"></script>

Node

npm i --save @mixer/interactive-node

Usage

Authentication

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.

Browser

index.html

<doctype html>
<html>
    <head>
        <title>Interactive 2</title>
    </head>
    <body>
        <script src="js/interactive.js"></script>
        <script src="js/app.js"></script>
    </body>
</html>

app.js

const client = new interactive.GameClient();

client.open({
    authToken: '<OAuth Token>',
    versionId: 1234,
});

Node

JavaScript

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,
});

TypeScript

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,
});

Examples

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!

Documentation

Checkout our reference docs here.

Development

To get a development environment setup:

  1. Clone this repository
  2. npm install
  3. npm run build

Contributing

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.

interactive-node's People

Contributors

acthomas06 avatar aechdub avatar alfw avatar andrewl33 avatar artdude543 avatar connor4312 avatar deekyjay avatar drethic avatar ethanwaite avatar jamesbirtles avatar johnycilohokla avatar kateract avatar luket avatar metaa avatar mobius5150 avatar pahimar avatar probableprime avatar simonschick avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.