Quick Start
Guide
Starting a basic io.Connect Browser project is easy and intuitive, as this guide will show you. To quick start your project, you have to set up a Main app app (Browser Platform) and optionally a second app - a Browser Client.
Main App
Create standard basic
index.html
andindex.js
files for your Main app.Reference the
@interopio/browser-platform
library and yourindex.js
in theindex.html
file:
<script src="https://unpkg.com/@interopio/browser-platform@latest/dist/browser.platform.umd.js"></script>
<script src="./index.js"></script>
- Initialize the
@interopio/browser-platform
library in theindex.js
file using theIOBrowserPlatform()
factory function and providing a valid license key:
const config = {
licenseKey: "my-license-key"
};
const { io } = await IOBrowserPlatform(config);
console.log(`io.Connect initialized successfully! io.Connect version: ${io.version}`);
Now you have a fully functioning Main app.
Browser Client
Create standard basic
index.html
andindex.js
files for your Browser Client app.Reference the
@interopio/browser
library and yourindex.js
in theindex.html
file:
<script src="https://unpkg.com/@interopio/browser@latest/dist/browser.umd.js"></script>
<script src="./index.js"></script>
- Initialize the
@interopio/browser
library in theindex.js
file using theIOBrowser()
factory function:
const io = await IOBrowser();
console.log(`io.Connect initialized successfully! io.Connect version: ${io.version}`);
Now you have a fully functioning Browser Client app that can be opened from the Main app - e.g., by using the Window Management API and the URL where the app was deployed:
// In index.js of the Main app.
const config = {
licenseKey: "my-license-key"
};
const { io } = await IOBrowserPlatform(config);
console.log(`io.Connect initialized successfully! io.Connect version: ${io.version}`);
const name = "My Browser Client";
const url = "https://example.com";
// Opening the Browser Client from the Main app.
const myWin = await io.windows.open(name, url);
Next Steps
Congratulations, you have created your very first io.Connect Browser project!
For deploying your project, see the Project Deployment section.
For more information on the Browser Platform and Browser Client apps, see the Browser Platform and Browser Client sections.
For more information on the @interopio/browser
library, see the API Reference section.