Integrate using Vue
Orama Cloud provides an Official SDK to help you integrate your indexes into your Vue application.
Installation
You can install the SDK using npm
, yarn
, pnpm
or any other package manager of your choice:
and
Usage
This SDK exports a composable you can use to search your index by passing it any params you want for your search and also your OramaClient instance.
As a first step please create a an OramaClient instance. Let’s make one in a file called orama.js
:
After completing this step, you are ready to use the useSearch
composable anywhere in your application to interact with the Orama Cloud API.
You can always find your public API key and endpoint in the Orama Dashboard. Here is an example of what it looks like:
Remember, the API key and endpoint are public, so you can include them in your frontend application.
API
The SDK provides a composable to interact with the Orama Cloud API. Here is a list of all the methods available:
Performing a full-text search query
The vue composable wraps the open source search method, maintaining backward compatibility with the Open Source API.
Performing vector search
You can perform a vector search using the useSearch
hook by changing the mode, for example:
You can read the full documentation on vector search using the JavaScript API here and remember that anything you can pass to client.search
you can also pass to useSearch
.