Plugins in Spotube are used for fetching metadata (Playlist, Album, Artist, Track Info, Search etc) and scrobbling. It gives developers access to Spotube’s internal APIs to create custom metadata providers and audio scrobblers.
Plugins needs to be written in hetu_script, which is a Dart-based scripting language. You probably never heard of it before.
To develop plugins for Spotube, you need to have the following requirements:
- Basic programming knowledge
- Dart and Flutter knowledge
- Visual Studio Code or any other code editor
Spotube uses hetu_script. It’s kind of similar to Typescript. Learning it shouldn’t take much time if you already know Dart or Javascript.
Go to Hetu Script’s official website and documentation to learn more about it.
The hetu_script
programming/scripting language is relatively new. So there’s no ecosystem around it yet.
However, we created some helpful libraries to aid with Spotube plugin development. The hetu-community is a
community driven effort to create libraries and tools for Hetu Script. Below are available libraries:
- hetu-community/hetu_std: A standard library for Hetu Script. Provides basic functionality like Http client, DateTime, Cryptography API, encoding/decoding (JSON, Utf8, Base32) etc.
- KRTirtho/hetu_spotube_plugin: A library for Spotube plugin development. It provides access to Spotube’s internal APIs (Webview, Forms, LocalStorage etc.) and utilities for fetching metadata and scrobbling.
You can find more libraries in the hetu-community GitHub organization.
- Hetu Script Plugin for VSCode: A VSCode extension for Hetu Script. It provides basic syntax highlighting support. But it doesn’t support LSP (Language Server Protocol) yet so no autocompletion or linting is available.
- hetu_script_dev_tools: A CLI tool for compiling hetu script files to bytecode or directly running them and a REPL