Shell

Open URLs in the user's system browser from a plugin.

Shell API for plugins

The Shell API lets plugins use select functions to interact with the user's system. It lets you support OAuth flows where the user needs to approve access on an external site.

circle-info

Access the Shell API via api.Shell.* in your plugin's lifecycle hooks.


Usage

A typical use case is redirecting the user to an external auth page:

import type { NuclearPluginAPI } from '@nuclearplayer/plugin-sdk';

export default {
  async onEnable(api: NuclearPluginAPI) {
    const token = await getAuthToken();
    const authUrl = `https://example.com/auth?token=${token}`;
    await api.Shell.openExternal(authUrl);
  },
};

Reference

Opens url in the user's default system browser. Delegates to Tauri's opener plugin.

Types

Last updated