For the complete documentation index, see llms.txt. This page is also available as Markdown.

Navigation

Open pages in Nuclear, navigate back and forward, and read the current location from a plugin.

The Navigation API is designed to work like the browser history API. You can open navigate to specified views in Nuclear, go back and forward in the navigation history, and read the location of the current page.

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


Usage

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

const showArtist = async (api: NuclearPluginAPI, providerId: string, artistId: string) => {
  await api.Navigation.navigate(`/artist/${providerId}/${artistId}`);
};

const showSearchResults = async (api: NuclearPluginAPI, query: string) => {
  await api.Navigation.navigate(`/search?q=${encodeURIComponent(query)}`);
};

Reference

Opens the page at path. The path is a route of Nuclear, with a search string if the page needs one. Some examples:

Path
Page

/dashboard

Dashboard

/search?q=<query>

Search results

/artist/<providerId>/<artistId>

Artist

/album/<providerId>/<albumId>

Album

/playlists/<playlistId>

Playlist

/favorites/tracks

Favorite tracks

Go back or forward one page in the navigation history.

Returns the location of the current page. At /search?q=radiohead, it returns:

Types

Last updated