Client-side library for connecting to Composite backend service
Download or clone the /build/min/composite.min.js
into your site. It’s
possible to use RequireJS or Browserify as well (see below). Include the file
like any other script <script src=”{directory}/composite.min.js”></script>
.
The composite
file exposes a Composite
constructor that you’ll use to
connect, send messages, and listen for events on. A simple example would be:
// Instantiate the library, connect, and listen for a response
var composite = new Composite();
composite.on(‘init’, function(response) {
console.log(response);
});
composite.connect(‘http://yourUrlHere/composite’);
For complete documentation, view: