Is there an example on how to call the delivery api from a plugin

Hi,

I am trying to write a plugin that takes the top level components and add it to a dropdown, for the user to select and add an anchor link to the selected section.

How do I get the content of a story inside a plugin?

Cheers.

Hello Donato,

you can access the actual story with this.api.get('cdn/stories/' + this.storyId) and here is an actual working example how and where you can use it in your plugin: https://gist.github.com/onefriendaday/f45567f9156ade7b1f327db45d22fbea#file-fieldtype-js-L16

We have made the codes of working plugins available through this page https://app.storyblok.com/#!/me/plugins and additionally are more plugin examples in this gist available https://gist.github.com/onefriendaday

You can access the area mentioned above by clicking on the small triangle to the right of the Storyblok logo:

With best regards
Hannes

Fantastic, thank you!

1 Like