AppTitle
Spicetify provides a set of API methods to interact with the Spotify client app title.
note
These methods only works for default app title.
namespace AppTitle {
function set(title: string): Promise<{ clear: () => void }>;
function reset(): Promise<void>;
function get(): Promise<string>;
function sub(callback: (title: string) => void): { clear: () => void };
}
Methods
set
Set default app title and forces it until cancelled. This will override any previous forced title.
note
This will temporarily override the current title if a track is being played until the player changes track or the user interacts with the player.
function set(title: string): Promise<{ clear: () => void }>;
Parameters
Name | Type | Description |
---|---|---|
title | string | Title to set |
Returns
Promise that resolves to a function to cancel forced title. This doesn't reset the title.
Example
await Spicetify.AppTitle.set("My Extension");
reset
Reset app title to default.
function reset(): Promise<void>;
Example
await Spicetify.AppTitle.reset(); // Spotify Premium
get
Get current default app title.
note
This method cannot get the title of the currently played track.
function get(): Promise<string>;
Returns
Current default app title.
Example
const title = await Spicetify.AppTitle.get();
console.log(title); // Spotify Premium
sub
Subscribe to title changes.
note
This event is not fired when the player changes app title.
function sub(callback: (title: string) => void): { clear: () => void };
Parameters
Name | Type | Description |
---|---|---|
callback | (title: string) => void | Callback to call when title changes |
Returns
Object with method to unsubscribe.
Example
const { clear } = Spicetify.AppTitle.sub((title) => {
console.log(title);
});
await Spicetify.AppTitle.set("My Extension"); // Console: My Extension
clear();