Skip to content

🐇 JS client library for the Leap Edge socket service

Notifications You must be signed in to change notification settings

hopinc/leap-edge-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leap-edge-js

Utility library for connecting and receiving events from Leap Edge. Used for Channels.

Usage

Connecting

import {LeapEdgeClient} from 'leap-edge-js';

const projectId = 'project_xxx';
const token = 'leap_token_xxx';

const leap = new LeapEdgeClient({projectId, token});
leap.connect();

If you don't want to supply a token (e.g. to only connect to unprotected channels), then just don't include the token in the authentication parameters object

Listening for Connection Status Updates

leap.on('connectionStatusUpdate', (status: LeapConnectionStatus) => {
	// do something with status
});

Listening for Service Events

leap.on('serviceEvent', ({channelId, eventType, data}: LeapServiceEvent) => {
	// do something
});

About

🐇 JS client library for the Leap Edge socket service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published