SDK for building and communicating with web execution environments that are embedded as iframes in Coding Rooms
First get the distribution: npm install @exlinc/cc-web-exec-sdk
All web exec implementations, should create a single instance of CCWebExecClient
in their iframe and then implement their event listeners/senders on that instance.
For an example implementation in plain JS:
-
examples/js-demo/iframe.html
>>> This is an example implementation ofCCWebExecClient
(probably what you need) -
examples/js-demo/index.html
>>> This is an example implementation of theCCWebExecManager
for example/testing purposes ONLY. This is implemented by Coding Rooms -- your app only needs to implement the client-side of this framework.
To play with the JS example, load examples/js-demo/index.html
in your browser. It uses a relative path to load in the iframe.
A CDN for plain JS implementations/demos is available via UNPKG: https://unpkg.com/@exlinc/[email protected]/dist/cc-web-exec-sdk.js
(not really recommended for production; better to package yourself)
The simplest+safest way to implement this library for production use is via the TypeScript interface. Types are provided in the NPM distribution.
A list of the supported event types are available here: src/consts.ts
A list of the supported event payloads are available here: src/models.ts
git clone https://github.com/exlinc/cc-web-exec-sdk
cd cc-web-exec-sdk
npm install
The build step places cc-web-exec-sdk.js
into the dist/
directory of the project. This is the only required output bundle.
npm run build
npm publish