Skip to content

Commit

Permalink
Merge pull request #18 from askorama/better-vue
Browse files Browse the repository at this point in the history
  • Loading branch information
SaraVieira authored Apr 28, 2024
2 parents 71e5847 + a1e4f50 commit 737dc51
Show file tree
Hide file tree
Showing 5 changed files with 3,225 additions and 2,126 deletions.
20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,7 @@ function Search() {

## With Vue

### Set up Orama Cloud singleton

Create an orama.ts file in the src folder to create an Orama Cloud Client instance that you’ll use throughout your application.

```ts
import { OramaClient } from "@oramacloud/client";

export const client = new OramaCloud({
apiKey: "<Your Orama Cloud API Key>",
endpoint: "<Your Orama Cloud Endpoint>",
});
```

### Use the client instance in your component
Import the composable into your component and it's ready to use.

```jsx
<template>
Expand All @@ -197,7 +184,10 @@ import { useSearch } from "@oramacloud/client/vue";
import { orama } from './orama'

const { results } = useSearch({
client,
cloudConfig: {
apiKey: "<Your Orama Cloud API Key>",
endpoint: "<Your Orama Cloud Endpoint>",
},
term: "guitar",
limit: 5
});
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
"scripts": {
"format": "bunx @biomejs/biome format src --write",
"build": "npm run build:lib && npm run build:react && npm run build:vue",
"dev": "run-p watch:lib watch:react watch:vue",
"watch:lib": "tsup --config tsup.lib.js --watch",
"watch:react": "tsup --config tsup.react.js --watch",
"watch:vue": "tsup --config tsup.vue.js --watch",
"build:lib": "tsup --config tsup.lib.js",
"build:react": "tsup --config tsup.react.js",
"build:vue": "tsup --config tsup.vue.js",
Expand All @@ -53,27 +57,22 @@
"license": "ISC",
"dependencies": {
"@orama/orama": "^2.0.16",
"@orama/stemmers": "^2.0.16",
"@orama/stopwords": "^2.0.16",
"@paralleldrive/cuid2": "^2.2.1",
"lodash": "^4.17.21",
"lodash.debounce": "^4.0.8",
"lodash.throttle": "^4.1.1",
"react": "^18.2.0",
"vue": "^3.4.23"
"vue": "^3.4.25"
},
"devDependencies": {
"@biomejs/biome": "^1.4.1",
"@fastify/formbody": "^7.4.0",
"@types/lodash": "^4.14.202",
"@types/lodash.debounce": "^4.0.9",
"@types/lodash.throttle": "^4.1.9",
"@types/node": "^20.3.1",
"@types/react": "^18.2.14",
"dotenv": "^16.3.1",
"esbuild": "0.18.5",
"fastify": "^4.19.2",
"husky": "^8.0.3",
"npm-run-all": "^4.1.5",
"openai": "^4.24.1",
"ts-standard": "^12.0.2",
"tsup": "^7.1.0",
Expand Down
Loading

0 comments on commit 737dc51

Please sign in to comment.