- Welcome to Moosync
- 3rd party integrations
- Building from source
A moosync extension can be split into 3 parts
- Lifecycle hooks
There are 2 optional lifecycle hooks for an extension
onStarted hook is invoked after moosync’s extension host has started or after the extension has been installed.
This method only signifies that your extension can now communicate with moosync.
It is recommended to initialize your custom code in this method.
onStopped hook is invoked after moosync’s extension host has stopped or after the extension has been uninstalled.
It is recommended to destroy all objects and stop all tasks in this method.
Your extension is provided with a global constant
For typescript, this can be declared inside your declaration file
declare const api: import('@moosync/moosync-types').extensionAPI
api exposes some methods, namely:
Events can be listened to using api.on(…)
List of events:
- ‘requestedPlaylists’ *
- ‘requestedPlaylistSongs’ *
- ‘playbackDetailsRequested’ *
- ‘customRequest’ *
- ‘requestedSongFromURL’ *
- ‘requestedPlaylistFromURL’ *
- ‘requestSearchResult’ *
- ‘requestedRecommendations’ *
- ‘requestedLyrics’ *
* These events require you to return some data from their callbacks