Connect your app to Algolia
You can connect your Lovable app to Algolia to add powerful search features like instant results, typo correction, and filtering. This helps your users find what they need quickly in product catalogs, documentation, or listings.
Anyone building an app that needs advanced search capabilities beyond basic database queries, like e-commerce or content sites.
Do this, in order
- 1
Sign in to your Algolia dashboard and select the application you want to use.
This is where you'll find the necessary IDs and keys to connect Algolia to Lovable.
- 2
Go to 'Settings' then 'API Keys' in your Algolia dashboard to find your Application ID.
Your Application ID is a unique identifier for your Algolia project that Lovable needs.
- 3
Create a new backend API key in Algolia, giving it a descriptive name like 'Lovable backend'.
This key allows Lovable to securely perform actions like adding, updating, or searching your data. Make sure it has permissions for 'search', 'addObject', 'deleteObject', and 'settings' and is restricted to the indexes your app will use.
- 4
Optionally, create a separate public API key in Algolia with only 'search' permissions, if you want your app's frontend to search directly.
This key lets your app search Algolia faster without always going through Lovable's backend, but it must be strictly limited to search only.
- 5
In Lovable, go to 'Connectors' and select 'Algolia', then click 'Add connection'.
This starts the process of linking your Algolia account to your Lovable workspace.
- 6
Fill in the connection details: a display name, your Algolia Application ID, your secret backend API key, and optionally your public API key.
These details tell Lovable how to securely access and interact with your Algolia application.
- 7
Choose who in your Lovable workspace can use this Algolia connection.
This controls access to the Algolia connection for different projects and team members.
- 8
Click 'Connect' to finalize the setup.
Lovable will verify your keys and establish the connection, making Algolia available for your apps.
Paste this into your project
Connect my app to Algolia. I need to index records, run full-text search with typo tolerance, and build faceted filtering. I have my Algolia Application ID, a backend API key with 'search', 'addObject', 'deleteObject', and 'settings' ACLs, and an optional public API key with only 'search' ACL for frontend queries. I want to name this connection 'Algolia Prod' and make it available to the entire workspace.
Words decoded
- Full-text search
- A search that looks through all the words in a document or record, not just specific fields, to find relevant results.
- Faceted filtering
- A way to narrow down search results by selecting options from different categories, like filtering products by color, size, or brand.
- Indexing
- The process of organizing and storing your data in a special way so that it can be searched very quickly.
- Typo tolerance
- The ability of a search engine to understand what you mean even if you make spelling mistakes in your search query.
- Ranking
- How a search engine decides which results are most important and should appear higher in the list.
- ACLs (Access Control Lists)
- Rules that define what actions a specific API key is allowed to perform, like 'search' or 'add data'.
- Frontend
- The part of an app that users see and interact with directly in their web browser or on their device.
- Backend
- The part of an app that runs on a server, handling data storage, logic, and communication with other services, which users don't see directly.
- Connector gateway
- A secure service that acts as a middleman, allowing your Lovable app to talk to external services like Algolia without directly exposing sensitive keys.
Where people get stuck
- Do not use your Algolia admin API key for the Lovable connection; create a dedicated key with only the necessary permissions.
- Never share your secret backend API key publicly, as it functions like a password.
- Ensure your public API key (if used) only has 'search' permissions; Lovable will reject keys with broader access.
- Remember that Algolia is a search engine, not a primary database; you need to keep its index updated when your main data changes.
- Deleting a Lovable connection does not automatically delete your Algolia indexes; you must do this manually in Algolia if they are no longer needed.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.