JavaScript Examples for io.Connect Desktop
This repository contains basic examples of io.Connect enabled apps.
For more information on io.Connect Desktop, visit the official io.Connect product site or see the io.Connect Desktop documentation.
Prerequisites
- io.Connect Desktop
- node
- npm
Setup
- Clone the repository.
- Copy the
js-examples.json
configuration file and paste it in the io.Connect Desktop app configuration folder located at%LocalAppData%\interop.io\io.Connect Desktop\<ENV>-<REG>\apps
, where<ENV>-<REG>
represents the environment and region of io.Connect Desktop (e.g., DEMO-INTEROP.IO). - Open a command prompt in the base repo directory and run
npm install
to install all dependencies. - Run
npm start
to start a server at port 4242 where the apps will be hosted. - Start io.Connect Desktop.
Now you will be able to start all example apps from the io.Connect Desktop launcher. All examples are grouped in the "JavaScript Examples" folder.
Examples
App Management
This example app uses the App Management API to start and list apps and app instances:
- lists the names of all registered visible apps;
- lists the instances of the currently running visible apps;
- starts app instances;
- listens for any added or removed apps;
- listens for any started or stopped instances of apps;
App Preferences
This example demonstrates how to use the App Preferences API to save, update and retrieve custom app preferences for the current user.
Channels
This example contains two apps which use the Channels API. You can open more than one instance of the subscriber app to use different Channels.
Channels Publisher
After selecting a Channel, you can publish any data to the current Channel or to any other Channel.
Channels Subscriber
Select a Channel from the Channel Selector UI or join/leave Channels programmatically. Get the context of any Channel. The context data of the current Channel is also displayed in the app.
Flydown
App demonstrating the flydown window functionality in io.Connect Desktop.
Flydown App
The app that will trigger the flydown window.
Flydown Window
The window that will be used as a flydown window.
Intents
This example contains two apps that use the Intents API.
Client List
Select a client to start the Client Portfolio app with the selected client as its context. If the Client Portfolio app is already running, selecting a client will update its context.
Client Portfolio
This app is registered as an Intent handler and will be started when you select a client in the Client List app, or if already running, its context will be updated and it will show the selected client's portfolio.
Interop Request/Response
This example contains two apps which use the Interop API to communicate.
Interop Request
Select a company from the list to invoke an Interop method registered by the Interop Response app.
Interop Response
Registers an Interop method that will show details about the selected company in the Interop Request app.
Interop Streaming
Basic Interop Streaming example consisting of an Interop Publisher and an Interop Subscriber apps.
Interop Publisher
Creates a stream and handles stream subscriptions. Shows publishing stream data to all subscribers and to a specific stream branch.
Interop Subscriber
Subscribes to a stream and shows the received stream data. You can open more than one Interop Subscriber instance to test various streaming scenarios.
Popup
App demonstrating the popup window functionality in io.Connect Desktop.
Popup App
The app that will trigger the popup window.
Popup Window
The window that will be used as a popup window.
Pub/Sub
Two apps using the Pub/Sub API to communicate.
Publisher
Publishes data on a topic.
Subscriber
Subscribes for data on a topic.
Search
Two apps using the Search API to register a search provider and create search queries.
Search Bar
Open the Search Bar from the io.Connect Desktop launcher or by pressing CTRL + SHIFT + S
. Type and press the "Search" button or Enter
to search. Press Esc
or the "Close" button to hide the Search Bar. The Search Bar will hide also when it loses focus. Selecting an action from the results, will execute it; selecting a Workspace, will open it; selecting a client, will open the io.Connect Desktop Client Contact demo app showing info about the selected client.
Search Provider
Starts automatically as a hidden service app and registers itself as a search provider for actions, Workspaces and clients. Registers a shortcut for opening the Search bar and Interop methods for executing actions when the user clicks a result in the Search Bar.
Shared Contexts
Two apps that use the Shared Contexts API to communicate.
Client List
Selecting a client in the app updates a shared context object with the client ID.
Client Portfolio
Subscribes for context updates and shows the selected client's portfolio based on the updated client ID in the shared context object.
Themes
This example demonstrates using the Themes API to get all available themes, get the current theme, select a theme and subscribe for theme change events.
Window Management
Example of controlling the current or other io.Connect Windows using the Window Management API.
My Window
App demonstrating controlling the current io.Connect Window.
Window Manipulation
App demonstrating opening and controlling io.Connect Windows.