hackhands
HackHands JS SDK
Last updated 3 years ago by assisantunes .
ISC · Original npm · Tarball · package.json
$ cnpm install hackhands 
SYNC missed versions from official npm registry.

Pluralsight Mentor - JS SDK

This codebase can be used in server-side (node) and client-side (Browser)

Modules

Constructor

Responsible to initialize a new instance of the SDK. You can use multiple instances in the same app/process. Check the full documentation under docs/Constructor.md


Authentication

Responsible for authenticate a instance in correct user (mentor or student). Multiple methods are available, check the full documentation under docs/Authentication.md


Notifications

This module allows a mentor to listen for new requests in realtime. Check the full documentation under docs/Notification.md


Session

Module responsible for everything that happens inside the session environment. Some functionalities include Pause/Resume/Close a session and send messages via Chat system. Check the full documentation under docs/Session.md


Api

Generic module that allows to fetch and set data on the Mentor API. Check the full documentation under docs/Api.md


Real world examples

Basic usage

// Set your settings to initiate a SDK instance
var settings = {
    debug: 'false',
    environment: 'stage'
}

var HH = HHSDK(settings);

Listen for new requests and send to a slack channel

var HH = require('HHSDK')()

// Authenticate using a expert token
HH.authentication.token('4bbc662534c0e881...c5e1')

HH.notifications.on('session:available', function(session){
    // Create a payload to send to slack
	var slackPayload = JSON.stringify({
		"icon_url": session.issue.author.profile_thumb.large,
		"username": session.issue.author.name + '',
		"text": "[*_"+session.issue.department.title + "_*] `"+session.issue.title+"`\n"+session.issue.description+"\n\n <https://hackhands.com/session/"+session.issue.key+"/| :computer: Connect to this session>"
	});
    // Send to slack
    require('request').post('https://hooks.slack.com/yourKey').form({payload: slackPayload})
});

Current Tags

  • 3.7.2                                ...           latest (3 years ago)

1 Versions

  • 3.7.2                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (6)
Dev Dependencies (30)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |