API Docs for version 1.3.1811

Circuit Module

Summary

Circuit SDK module.

Main class is Client which exposes the messaging and real-time APIs for a particular user.

Here is an example that creates a client instance, performs a login, registers for an itemAdd event and sends a new text message.

// Create Circuit client instance
const client = new Circuit.Client({
    client_id: '<your client_id>',
    domain: '<circuit system, defaults to circuitsandbox.net>'
});

// Authenticate with OAuth2. User will see the Circuit OAuth2 popup.
const user = await client.logon();

// Listen for itemAdded event
client.addEventListener('itemAdded', evt => console.log('Item received:', evt.item));

// Send text item on a specific conversation
const item = await client.addTextItem('3154f545-1a6a-493a-8448-3c5cfa5a6b11', 'Hello World');

View the examples on circuit.github.io.

New to Circuit? Register for a free developer account.

This module is a rollup of the following modules: