Skip to content

Commit

Permalink
Add documentation for sending events with DocSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
8bittitan committed Jun 2, 2023
1 parent 12b08d0 commit fc69998
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions packages/website/docs/DocSearch-v3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,46 @@ docsearch({

</Tabs>

### Sending events

You can send search events to your DocSearch index by passing in the `insights` parameter when creating your DocSearch instance.

<Tabs
groupId="language"
defaultValue="js"
values={[
{ label: 'JavaScript', value: 'js', },
{ label: 'React', value: 'react', }
]
}>
<TabItem value="js">

```js
docsearch({
searchParameters: {
facetFilters: ['language:en', 'version:1.0.0'],
},
insights,
});
```

</TabItem>

<TabItem value="react">

```jsx
<DocSearch
searchParameters={{
facetFilters: ['language:en', 'version:1.0.0'],
}}
insights
/>
```

</TabItem>

</Tabs>

## Performance optimization

### Preconnect
Expand Down

0 comments on commit fc69998

Please sign in to comment.