1.4.0 • Published 1 year ago

@remotehq/remote-browser-sdk v1.4.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
1 year ago

@remotehq/remote-browser-sdk

The official JavaScript/TypeScript client SDK for embedding and controlling Remote Browser by RemoteHQ.

Installation

# via npm
npm install --save @remotehq/remote-browser-sdk

# via yarn
yarn add @remotehq/remote-browser-sdk

Usage example

import * as remoteBrowserSdk from "@remotehq/remote-browser-sdk";

// 1. Get instanceURN via API call
const instanceURN = "..."; // received from the API

// 2. Create new client instance
const rbClient = remoteBrowserSdk.createClient({
  instanceURN,
  iframeSource: "rhq", // unique value per customer
  role: "...", // unique value representing a role (returned via API when creating new instance)
  userName: "Jon",
  allowFullscreen: true,
  disableAudio: false,
  logoUrl: "...", // customize the experience by changing default logo to your own
  targetOrigin: "https://rooms.remotehq.com", // If we setup a custom domain for you - you'll need to change this value
  barLocation: "top-right" // or 'top-left', determines location of the top navigation
});

// 3. Attach to DOM
rbClient.attach("#remote-browser-container"); // Selector or Element

// 4. Enjoy external API to control the Remote Browser
rbClient.openInCurrentTab("https://weather.com");
rbClient.openInNewTab("https://weather.com");

// 5. Listen for extra messages
function onError (error) { ... }
this.rbClient.on('openInCurrentTab:error', onError);
this.rbClient.off('openInCurrentTab:error', onError);

// 6. Destroy when not using anymore
rbClient.destroy();

Documentation

For full documentation, visit the official RemoteHQ documentation.

1.4.0-beta.1

1 year ago

1.4.0

1 year ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago