Developer

Browser API

Open URLs in the system default browser.

Browser API

The Browser API opens URLs in the user’s default system browser.

Capability required: browser:open

Frontend (iframe)

import { createResourceClient } from "@rightplace/sdk";

const rp = createResourceClient();
await rp.ready();

// Open a URL in the system browser
await rp.browser.open("https://example.com");

// Open documentation
await rp.browser.open("https://docs.example.com/api");

Backend (Node.js)

import { createResourceServer } from "@rightplace/sdk/server";

const server = createResourceServer({
  methods: {
    openDashboard: async (params, { rp }) => {
      await rp.browser.open(`https://dashboard.example.com/${params.id}`);
      return { ok: true };
    },
  },
});

server.start();

API Reference

rp.browser.open(url)

ParameterTypeDescription
urlstringThe URL to open
ReturnsPromise<void>

Manifest Configuration

{
  "capabilities": [
    "browser:open"
  ]
}

Notes

  • URLs are opened in the user’s default system browser (Safari, Chrome, Firefox, etc.), not in RightPlace’s built-in browser.
  • Only http:// and https:// URLs are supported.
  • Use this for external links, OAuth flows, documentation references, or any URL the user should interact with outside of your resource.