Algolia
In this part of the documentation, we will show you how to integrate Algolia into your Boilerplate.
Overview
Integrating Algolia into your SaaSBold boilerplate will enhance your application's search functionality, providing your users with fast and relevant search results.
Follow the steps below to integrate Algolia:
Step-by-Step Guide
-
Create an Algolia Account
Log in to your Algolia (opens in a new tab) dashboard. If you don’t have an account, go ahead and create one. -
Create a project
Go to the dashboard, click on Application and, then click on the Create Application button. Follow the steps to create the application.Note
It’ll create an unnamed application. If you prefer to change the name go to: Settings>Applications.After creating the application you’ll be redirected to a page for importing data.
For now click on Skip for now, you can import data or use the crawler of Alogolia to extract data from your site later on.
-
Application ID & Search API Key
These values are for the below environment variables
NEXT_PUBLIC_ALGOLIA_APPLICATION_ID= NEXT_PUBLIC_ALGOLIA_SEARCH_API_KEY=
Alternatively, if you do not see this section below on the Overview page. You can go to your account settings>Applications
You’ll see a list of all the application you created. Click on the application you want to use for this project.
Now you’ll be redirected to this page. Click on API Keys
Now copy the Application ID and Search API Key and store it in your environment variables
-
Create an Index Name
From the Overview page click on Data sources
Now from the Indices tab click on Create Index
A modal will open, enter your preferred Index name.
A rule of thumb we suggest for naming the index: Describes what it stores. So your name will reflect the data Algolia will store on that index name. Additionally prefix the name with the environment you’ll be using it in(e.g development, production).
Now click on Create.
Store this index name in your env. You’ll find a variable
NEXT_PUBLIC_ALGOLIA_INDEX_NAME
By following these steps, you can successfully integrate Algolia into your SaaSBold boilerplate, providing an efficient search experience for your users.