Browse topics
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)
| Parameter | Type | Description |
|---|---|---|
url | string | The URL to open |
| Returns | Promise<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://andhttps://URLs are supported. - Use this for external links, OAuth flows, documentation references, or any URL the user should interact with outside of your resource.