How to index entries from Storyblok with Algolia
Storyblok is the first headless CMS that works for developers & marketers alike.
In this article, we will check out how we can index the content of Storyblok in Algolia with just a few lines of code using node.js
.
You could be interested also in our article on how to integrate Algolia with your Headless CMS.
Start a new node project using the command below:
Installation
Please install storyblok-js-client, alogoliasearch and axios according to the following code block.
Configuration of Algolia Indexer
Create index.js with the following content. The comments will guide you through the whole implementation. You will need your space preview or public token to exchange the STORYBLOK_CONTENT_DELIVERY_API_TOKEN
placeholder and your ALGOLIA_APP_ID
as well as ALGOLIA_API_ADMIN_TOKEN
.
Filtering Content in Storyblok
Instead of using Algolia to filter and query your content of Storyblok, we can highly recommend you to check out our Content Delivery feature called filter_query
as this allows you to perform query actions on your content without any additional indexing step when entered in Storyblok.
Resource | Link |
---|---|
How to integrate Algolia with your Headless CMS | https://www.storyblok.com/tp/headless-algolia-integration |
Algoalia Indexing API | https://www.algolia.com/doc/api-client/methods/indexing/ |