Integrate Meilisearch Cloud with Vercel

    In this guide you will learn how to link a Meilisearch Cloud instance to your Vercel project.

    Introducing our tools

    What is Vercel?

    Vercel is a cloud platform for building and deploying web applications. It works out of the box with most popular web development tools.

    What is Meilisearch Cloud?

    Meilisearch Cloud offers a managed search service that is scalable, reliable, and designed to meet the needs of all companies.

    Integrate Meilisearch into your Vercel project

    Create and deploy a Vercel project

    From your Vercel dashboard, create a new project. You can create a project from a template, or import a Git repository.

    Create a new project on Vercel dashboard

    Select your project, then click on Deploy. Once deployment is complete, go back to your project’s dashboard.

    Add the Meilisearch integration

    Go to the project settings tab and click on Integrations on the sidebar menu to the left of your screen.

    Selecting the integration tab in the project settings

    Search for the Meilisearch integration in the search bar. Click on the Add integration button.

    Meilisearch integration page in Vercel's marketplace

    Select the Vercel account or team and the project you to which you want to add the integration. You may add the Meilisearch integration to one or more projects in this menu.

    Form to add Meilisearch integration, the "Specific projects" option is selected

    Click on Continue. Vercel will display a list with the permissions the integration needs to work properly. Review it, then click on Add Integration.

    Set up Meilisearch Cloud

    Vercel will redirect you to the Meilisearch Cloud page. Log in or create an account. New accounts enjoy a 14-day free trial period.

    You can choose an existing project or create a new one. To create a new project, complete the form with the project name and region.

    Meilisearch Cloud form to create a project complete, with "search-app" as the project's name and "Frankfurt" as the region

    Once you click on Create project, you should see the following message: “Your Meilisearch + Vercel integration is one click away from being completed.” Click "Finish the Vercel integration setup". Meilisearch will then redirect you back to the Vercel integration page.

    Meilisearch integration page in Vercel's dashboard

    Understand and use Meilisearch API keys

    Meilisearch creates two default API keys: Default Search API Key and Default Admin API Key.

    Admin API key

    Use the Default Admin API Key, to control who can access or create new documents, indexes, and change index settings. Be careful with the admin key and avoid exposing it in public environments.

    Search API key

    Use the Default Search API Key to access the search route. This is the one you want to use in your front end.

    Both keys are automatically added to Vercel along with the Meilisearch URL.

    TIP

    The master key–which hasn’t been added to Vercel–grants users full control over an instance. You can find it in your project’s overview on your Meilisearch Cloud dashboard. Read more about Meilisearch security.

    Review your project settings

    Go back to your project settings and check the new Meilisearch environment variables:

    Display the environment variables in the project settings

    TIP

    When using Next.js, ensure you prefix your browser-facing environment variables with NEXT_PUBLIC_. This makes them available to the browser side of your application.

    Take advantage of the Meilisearch Cloud dashboard

    Meilisearch Cloud dashboard: overview of the "search-app" project

    Use the Meilisearch Cloud dashboard, to index documents and manage your project settings.

    Resources and next steps

    Check out the quick start guide for a short introduction on how to use Meilisearch. We also provide many SDKs and tools, so you can use Meilisearch in your favorite language or framework.

    You are now ready to start searching!