@oramacloud/client
Advanced tools
Comparing version 1.0.0-beta.19 to 1.0.0-beta.20
{ | ||
"name": "@oramacloud/client", | ||
"version": "1.0.0-beta.19", | ||
"version": "1.0.0-beta.20", | ||
"description": "Orama SDK for Node.js, Deno, and Browsers", | ||
@@ -22,4 +22,19 @@ "type": "module", | ||
"types": "./dist/react/index.d.ts" | ||
}, | ||
"./vue": { | ||
"require": "./dist/vue/index.cjs", | ||
"import": "./dist/vue/index.js", | ||
"types": "./dist/vue/index.d.ts" | ||
} | ||
}, | ||
"scripts": { | ||
"lint": "ts-standard --fix", | ||
"build": "npm run build:lib && npm run build:react", | ||
"build:lib": "tsup --config tsup.lib.js", | ||
"build:react": "tsup --config tsup.react.js", | ||
"build:vue": "tsup --config tsup.vue.js", | ||
"test": "tsx tests/index.test.ts", | ||
"serve:example": "esbuild src/index.ts --bundle --outfile=example/out.js --format=esm --watch --servedir=example", | ||
"prepare": "husky install" | ||
}, | ||
"keywords": [ | ||
@@ -43,3 +58,4 @@ "orama", | ||
"@paralleldrive/cuid2": "^2.2.1", | ||
"react": "^18.2.0" | ||
"react": "^18.2.0", | ||
"vue": "^3.3.4" | ||
}, | ||
@@ -58,10 +74,8 @@ "devDependencies": { | ||
}, | ||
"scripts": { | ||
"lint": "ts-standard --fix", | ||
"build": "npm run build:lib && npm run build:react", | ||
"build:lib": "tsup --config tsup.lib.js", | ||
"build:react": "tsup --config tsup.react.js", | ||
"test": "tsx tests/index.test.ts", | ||
"serve:example": "esbuild src/index.ts --bundle --outfile=example/out.js --format=esm --watch --servedir=example" | ||
"ts-standard": { | ||
"ignore": [ | ||
"dist", | ||
"node_modules" | ||
] | ||
} | ||
} | ||
} |
# Orama Cloud Client | ||
## Install | ||
```js | ||
@@ -69,2 +70,45 @@ npm i @oramacloud/client | ||
} | ||
``` | ||
``` | ||
## With Vue | ||
### Set up Orama Cloud singleton | ||
Create a orama.ts file in the src folder to create a Orama Cloud Client instance that you’ll use throughout your application. | ||
```ts | ||
import { OramaCloud } from '@oramacloud/client/vue' | ||
export const orama = new OramaCloud({ | ||
apiKey: '<Your Orama Cloud API Key>', | ||
endpoint: '<Your Orama Cloud Endpoint>' | ||
}) | ||
``` | ||
### Use the client instance in your component | ||
```jsx | ||
<template> | ||
<li v-for="hit in searchResults?.hits" :key="hit.id"> | ||
{{ hit.id }} | ||
</li> | ||
</template> | ||
<script setup> | ||
import { ref, onMounted } from 'vue' | ||
import { orama } from './orama' | ||
const searchResults = ref(null) | ||
onMounted(async () => { | ||
if (orama) { | ||
const { results, error } = await orama.search({ | ||
term: 'guitar', | ||
limit: 5 | ||
}) | ||
searchResults.value = results | ||
} | ||
}) | ||
</script> | ||
``` |
5
114
10
179461
4
17
205
+ Addedvue@^3.3.4
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/parser@7.26.5(transitive)
+ Added@babel/types@7.26.5(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@vue/compiler-core@3.5.13(transitive)
+ Added@vue/compiler-dom@3.5.13(transitive)
+ Added@vue/compiler-sfc@3.5.13(transitive)
+ Added@vue/compiler-ssr@3.5.13(transitive)
+ Added@vue/reactivity@3.5.13(transitive)
+ Added@vue/runtime-core@3.5.13(transitive)
+ Added@vue/runtime-dom@3.5.13(transitive)
+ Added@vue/server-renderer@3.5.13(transitive)
+ Added@vue/shared@3.5.13(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addedentities@4.5.0(transitive)
+ Addedestree-walker@2.0.2(transitive)
+ Addedmagic-string@0.30.17(transitive)
+ Addednanoid@3.3.8(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpostcss@8.5.1(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedvue@3.5.13(transitive)