Skip to content

Fix frontend integration guides#3595

Merged
qdequele merged 3 commits into
mainfrom
fix-frontend-integration-guides
Jun 15, 2026
Merged

Fix frontend integration guides#3595
qdequele merged 3 commits into
mainfrom
fix-frontend-integration-guides

Conversation

@CaroFG

@CaroFG CaroFG commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #3165

Checklist

For internal Meilisearch team member only:

For external maintainers

  • Did you use any AI tool while implementing this PR (code, tests, docs, etc.)? If yes, disclose it in the PR description and describe what it was used for. AI usage is allowed when it is disclosed.
  • Have you made sure that the title is accurate and descriptive of the changes?

Overview

This PR fixes frontend integration documentation and examples by updating code snippets and dependencies across multiple Instant Meilisearch integration guides. The changes address issue #3165, which reported that example codes were missing required parameters and contained deprecated references.

Changes

Documentation Updates

docsearch.mdx

  • Removed the prior VuePress-specific branching guidance
  • Updated HTML integration example to use the community-maintained meilisearch-docsearch component
  • Replaced deprecated docs-searchbar.js references with meilisearch-docsearch CDN assets from unpkg
  • Updated initialization to include required parameters: host, apiKey, and indexUid
  • Removed version-substitution notes and inputSelector configuration discussion

javascript.mdx

  • Updated the quick example from ES module imports (importmap-based) to CDN UMD builds
  • Changed to use instant-meilisearch.umd.min.js and instantsearch.js@4 from CDN
  • Simplified searchBox widget configuration to use shorthand factory syntax

react.mdx

  • Updated import and usage from instant-meilisearch to instantMeiliSearch
  • Modified searchClient initialization to use the correct instantMeiliSearch API call pattern

vue.mdx

  • Corrected capitalization: instantMeilisearchinstantMeiliSearch
  • Updated code snippets in both initial and subsequent App.vue examples
  • Adjusted indentation formatting in searchClient initialization

Impact

All four documentation files now include correct API references and initialization patterns, enabling users to properly implement frontend search integration with the required public API key parameter.

@CaroFG CaroFG requested a review from qdequele June 12, 2026 12:41
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Four quick-start documentation files are updated to correct and modernize broken front-end integration examples. Docsearch integration now uses the community-maintained meilisearch-docsearch component; JavaScript switches to UMD script tags; React and Vue snippets are corrected to use the proper instantMeiliSearch API capitalization and consistent initialization patterns.

Changes

Front-end Integration Guide Updates

Layer / File(s) Summary
Docsearch integration rework
getting_started/instant_meilisearch/docsearch.mdx
Table of contents, introductory text, and code example are updated to replace VuePress-specific guidance and the legacy docs-searchbar.js pattern with a streamlined integration using the meilisearch-docsearch component from unpkg.
JavaScript quick example UMD script tag conversion
getting_started/instant_meilisearch/javascript.mdx
Dependencies are loaded via direct <script> tags for UMD builds instead of importmap with ES modules, and searchBox widget registration is converted to shorthand factory syntax.
React quick-start API standardization
getting_started/instant_meilisearch/react.mdx
Three code snippets are updated to consistently use instantMeiliSearch (capital "S") API for searchClient initialization across initial setup, component configuration, and UI examples.
Vue quick-start API standardization
getting_started/instant_meilisearch/vue.mdx
Two App.vue code snippets are updated to use instantMeiliSearch (capital "S") API and reformatted for consistent indentation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • j-meili
  • ManyTheFish

Poem

🐰 A rabbit hops through docs so bright,
Fixing code examples, getting them right,
With instantMeiliSearch in place,
And docsearch components with grace,
The guides now work without a fright! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR updates all four frontend integration guides (JavaScript, Vue, React, and Docsearch) with corrected code examples. However, the PR description notes that the public API key parameter issue from #3165 is not fully addressed—examples still lack explicit public API key insertion instructions. Verify that all code examples now include the public API key parameter as required by issue #3165, or clarify if API key guidance is provided elsewhere in the documentation.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix frontend integration guides' is directly related to the main changes, which update documentation for frontend integration guides to fix broken code examples.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing frontend integration guides as specified in the linked issue #3165. The updates to JavaScript, Vue, React, and Docsearch documentation are within scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-frontend-integration-guides

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mintlify

mintlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
meilisearch-documentation 🟢 Ready View Preview Jun 12, 2026, 12:49 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
getting_started/instant_meilisearch/react.mdx (2)

118-118: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace "e.g." with "for example".

As per coding guidelines, prefer "for example" over "e.g." to keep documentation accessible.

📝 Proposed fix
-Now open your browser and navigate to your React app URL (e.g. `localhost:3000`), and start searching.
+Now open your browser and navigate to your React app URL (for example, `localhost:3000`), and start searching.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getting_started/instant_meilisearch/react.mdx` at line 118, Update the
sentence containing "Now open your browser and navigate to your React app URL
(e.g. `localhost:3000`), and start searching." by replacing "e.g." with "for
example" so it reads "Now open your browser and navigate to your React app URL
(for example `localhost:3000`), and start searching."; ensure only the
abbreviation is changed and spacing/punctuation around the parenthetical remains
correct.

Source: Coding guidelines


70-70: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update component name for consistency.

The text references "The Hits component" but the code example uses InfiniteHits. Update to "The InfiniteHits component" for accuracy.

📝 Proposed fix
-Add the `SearchBox` and `InfiniteHits` components inside the `InstantSearch` wrapper component. The Hits component accepts a custom Hit component via the `hitComponent` prop, which allows customizing how each search result is rendered.
+Add the `SearchBox` and `InfiniteHits` components inside the `InstantSearch` wrapper component. The InfiniteHits component accepts a custom Hit component via the `hitComponent` prop, which allows customizing how each search result is rendered.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getting_started/instant_meilisearch/react.mdx` at line 70, The documentation
text incorrectly refers to "The Hits component" while the example uses
InfiniteHits; update the sentence to reference "The InfiniteHits component" for
consistency and accuracy, and ensure it still mentions the hitComponent prop and
the SearchBox/InstantSearch wrapper (referencing InstantSearch, SearchBox,
InfiniteHits, and hitComponent) so readers know which components and prop are
involved.

Source: Coding guidelines

getting_started/instant_meilisearch/vue.mdx (3)

67-67: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix subject-verb agreement.

"These URL and API key point" should use singular "This URL and API key point" or plural "These URL and API key values point" for grammatical correctness.

📝 Proposed fix
-These URL and API key point to a public Meilisearch instance that contains data from Steam video games.
+This URL and API key point to a public Meilisearch instance that contains data from Steam video games.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getting_started/instant_meilisearch/vue.mdx` at line 67, The sentence "These
URL and API key point to a public Meilisearch instance..." has a subject-verb
agreement issue; change it to either "This URL and API key point to a public
Meilisearch instance..." if you mean the single pair, or "These URL and API key
values point to a public Meilisearch instance..." if you prefer plural—update
the sentence in getting_started/instant_meilisearch/vue.mdx accordingly to keep
tense and plurality consistent.

Source: Coding guidelines


98-106: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix indentation to match earlier code block.

The data() method and its contents lack consistent indentation compared to the first code block at lines 54-63. Add proper indentation for readability and consistency.

📝 Proposed fix
 export default {
-data() {
+  data() {
     return {
-    searchClient: instantMeiliSearch(
+      searchClient: instantMeiliSearch(
         'https://ms-adf78ae33284-106.lon.meilisearch.io',
         'a63da4928426f12639e19d62886f621130f3fa9ff3c7534c5d179f0f51c4f303',
-    ).searchClient,
+      ).searchClient,
     };
-},
+  },
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getting_started/instant_meilisearch/vue.mdx` around lines 98 - 106, The
data() block in the Vue snippet has inconsistent indentation; adjust the
indentation of the data() method and its returned object so the keys
(searchClient) and the instantMeiliSearch(...) call align with the style used
earlier (lines 54-63). Locate the data() function and its return object,
reformat the nested instantMeiliSearch(...) and .searchClient line to use the
same indentation level as the first code block, and ensure closing braces and
commas follow the same indentation pattern.

125-125: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace "e.g." with "for example".

As per coding guidelines, prefer "for example" over "e.g." to keep documentation accessible.

📝 Proposed fix
-Now open your browser, navigate to your Vue app URL (e.g., `localhost:5173`), and start searching.
+Now open your browser, navigate to your Vue app URL (for example, `localhost:5173`), and start searching.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getting_started/instant_meilisearch/vue.mdx` at line 125, Replace the
abbreviation "e.g." with the phrase "for example" in the sentence "Now open your
browser, navigate to your Vue app URL (e.g., `localhost:5173`), and start
searching." so it reads "Now open your browser, navigate to your Vue app URL
(for example, `localhost:5173`), and start searching."; update the parentheses
content and ensure punctuation/spacing remains correct around the replaced text.

Source: Coding guidelines

🧹 Nitpick comments (1)
getting_started/instant_meilisearch/docsearch.mdx (1)

140-140: 💤 Low value

Consider simplifying "Following on from this tutorial".

The phrase "Following on from this tutorial" could be more direct. Consider "Following this tutorial" or "Based on this tutorial" for clearer, more concise documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getting_started/instant_meilisearch/docsearch.mdx` at line 140, Update the
sentence describing the Meilisearch credentials: replace the phrase "Following
on from this tutorial" with a more concise alternative such as "Following this
tutorial" or "Based on this tutorial" in the line that explains the `host` and
`apiKey` fields (the sentence mentioning `MEILISEARCH_URL` and `Default Search
API Key`).

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@getting_started/instant_meilisearch/docsearch.mdx`:
- Around line 126-134: The snippet uses the wrong global name for the bundled
API: replace accesses to window.__docsearch_meilisearch__ with
window.docsearch_meilisearch so the destructuring const { docsearch } =
window.docsearch_meilisearch works; update the script-tag example that
constructs docsearch({ container, host, apiKey, indexUid }) to pull docsearch
from window.docsearch_meilisearch instead of window.__docsearch_meilisearch__.

---

Outside diff comments:
In `@getting_started/instant_meilisearch/react.mdx`:
- Line 118: Update the sentence containing "Now open your browser and navigate
to your React app URL (e.g. `localhost:3000`), and start searching." by
replacing "e.g." with "for example" so it reads "Now open your browser and
navigate to your React app URL (for example `localhost:3000`), and start
searching."; ensure only the abbreviation is changed and spacing/punctuation
around the parenthetical remains correct.
- Line 70: The documentation text incorrectly refers to "The Hits component"
while the example uses InfiniteHits; update the sentence to reference "The
InfiniteHits component" for consistency and accuracy, and ensure it still
mentions the hitComponent prop and the SearchBox/InstantSearch wrapper
(referencing InstantSearch, SearchBox, InfiniteHits, and hitComponent) so
readers know which components and prop are involved.

In `@getting_started/instant_meilisearch/vue.mdx`:
- Line 67: The sentence "These URL and API key point to a public Meilisearch
instance..." has a subject-verb agreement issue; change it to either "This URL
and API key point to a public Meilisearch instance..." if you mean the single
pair, or "These URL and API key values point to a public Meilisearch
instance..." if you prefer plural—update the sentence in
getting_started/instant_meilisearch/vue.mdx accordingly to keep tense and
plurality consistent.
- Around line 98-106: The data() block in the Vue snippet has inconsistent
indentation; adjust the indentation of the data() method and its returned object
so the keys (searchClient) and the instantMeiliSearch(...) call align with the
style used earlier (lines 54-63). Locate the data() function and its return
object, reformat the nested instantMeiliSearch(...) and .searchClient line to
use the same indentation level as the first code block, and ensure closing
braces and commas follow the same indentation pattern.
- Line 125: Replace the abbreviation "e.g." with the phrase "for example" in the
sentence "Now open your browser, navigate to your Vue app URL (e.g.,
`localhost:5173`), and start searching." so it reads "Now open your browser,
navigate to your Vue app URL (for example, `localhost:5173`), and start
searching."; update the parentheses content and ensure punctuation/spacing
remains correct around the replaced text.

---

Nitpick comments:
In `@getting_started/instant_meilisearch/docsearch.mdx`:
- Line 140: Update the sentence describing the Meilisearch credentials: replace
the phrase "Following on from this tutorial" with a more concise alternative
such as "Following this tutorial" or "Based on this tutorial" in the line that
explains the `host` and `apiKey` fields (the sentence mentioning
`MEILISEARCH_URL` and `Default Search API Key`).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2bf78a5c-15d8-4d0d-88fd-61569b2331e9

📥 Commits

Reviewing files that changed from the base of the PR and between 4430928 and 85b8bca.

📒 Files selected for processing (4)
  • getting_started/instant_meilisearch/docsearch.mdx
  • getting_started/instant_meilisearch/javascript.mdx
  • getting_started/instant_meilisearch/react.mdx
  • getting_started/instant_meilisearch/vue.mdx

Comment on lines +126 to 134
<script src="https://unpkg.com/meilisearch-docsearch@latest/dist/index.global.js"></script>
<script>
docsSearchBar({
hostUrl: '<your-meilisearch-host-url>',
const { docsearch } = window.__docsearch_meilisearch__;
docsearch({
container: '#docsearch',
host: '<your-meilisearch-host-url>',
apiKey: '<your-meilisearch-api-key>',
indexUid: 'docs',
inputSelector: '#search-bar-input',
debug: true // Set debug to true if you want to inspect the dropdown
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

What is the correct global variable name and initialization API for the meilisearch-docsearch library when loaded via script tag?

💡 Result:

When using the meilisearch-docsearch library via a script tag (CDN), the library exposes its functionality through the global variable window.docsearch_meilisearch [1][2][3]. To initialize the component, you must destructure the docsearch function from this global object and call it with the required configuration parameters [1][4]. Example implementation: <script src="https://unpkg.com/meilisearch-docsearch@latest/dist/index.global.js"></script> <script> const { docsearch } = window.docsearch_meilisearch; docsearch({ container: "#docsearch", host: "YOUR_HOST_URL", apiKey: "YOUR_SEARCH_API_KEY", indexUid: "YOUR_INDEX_UID", }); </script> The container parameter accepts either a CSS selector string (e.g., "#docsearch") or a DOM element [3][4]. Note that this library is distinct from the deprecated docs-searchbar.js, which used a different initialization API [5][6][7].

Citations:


Fix the meilisearch-docsearch global used by the script-tag example.

meilisearch-docsearch exposes its API on window.docsearch_meilisearch (not window.__docsearch_meilisearch__). With the incorrect global, the snippet won’t run. The rest of the docsearch({ ... }) config shape (including apiKey and indexUid) matches the expected initialization.

Suggested change
const { docsearch } = window.docsearch_meilisearch;
docsearch({
  container: '`#docsearch`',
  host: '<your-meilisearch-host-url>',
  apiKey: '<your-meilisearch-api-key>',
  indexUid: 'docs',
});
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@getting_started/instant_meilisearch/docsearch.mdx` around lines 126 - 134,
The snippet uses the wrong global name for the bundled API: replace accesses to
window.__docsearch_meilisearch__ with window.docsearch_meilisearch so the
destructuring const { docsearch } = window.docsearch_meilisearch works; update
the script-tag example that constructs docsearch({ container, host, apiKey,
indexUid }) to pull docsearch from window.docsearch_meilisearch instead of
window.__docsearch_meilisearch__.

@qdequele qdequele merged commit c26603b into main Jun 15, 2026
3 of 4 checks passed
@qdequele qdequele deleted the fix-frontend-integration-guides branch June 15, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite front-end integration guide

2 participants