Skip to Content
sdeck docs

Links

Let websites and other programs start something in your plugin.

sdeck://plugin/<your plugin>/<link> runs something in your plugin, from a website, a script or a shortcut. Say which links it has:

const show = plugin.link({
  id: "show",
  name: "Show a city",
  run: (context, { city }) => {
    if (city) weather.show(city.slice(0, 100));
  },
});

export default plugin.define({ links: [show] });

sdeck://plugin/sdeck-plugin-weather/show?city=Oslo then calls it with { city: "Oslo" }.

Any website can open a link, without the user meaning to. So:

  • Check the parameters as you would check anything from the internet.
  • Don't do anything that can't be taken back, costs money or sends something.
  • Never take a token or a password from one. For signing in, use sign-ins.

A link a plugin does not have opens its settings instead, and so does sdeck://plugin/<your plugin>. Links need "apiVersion": 5. All of sdeck's links are in the reference.