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.
Running the Indexer
After adding the above code and adjusting the configuration with your own needs you can execute the following command to create an index in Algolia.
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.
With just a few lines of code, you can not only access your content from Storyblok but you can easily index it using Algolia including auto-update of existing indexes and entries.
A web performance specialist and perfectionist. After working for big agencies as a full stack developer he founded Storyblok. He is also an active contributor to the open source community and one of the organizers of Stahlstadt.js.