Socket
Book a DemoInstallSign in
Socket

@remotehq/remote-browser-sdk

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remotehq/remote-browser-sdk

The official JavaScript library for embedding and controlling Remote Browser from RemoteHQ

latest
npmnpm
Version
1.4.0
Version published
Maintainers
2
Created
Source

@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.

Keywords

remotehq

FAQs

Package last updated on 15 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts