Orama Cloud SDKs
Orama Cloud comes with a set of officially supported Software Development Kits that allow you to interact and connect with the platform programmatically.
The SDKs are available in multiple programming languages and provide a set of APIs that allow you to perform various operations on the platform, from performing searches and creating answer sessions, to managing your index data and trigger new deployments.
Supported Languages
Orama Cloud offers Official SDKs for the following programming languages.
Some features may not be available in all SDKs yet.
Package | Search Engine | Answer Engine | Index Manager |
---|---|---|---|
Client JavaScript | |||
Client PHP | |||
Client Swift | |||
Client Kotlin | |||
Client Python (Coming soon) |
Do you want to see a specific language supported? Let us know!
JavaScript SDK
You can install the JavaScript SDK via any major package manager. It supports every JavaScript environment, from servers to browsers, and edge networks.
It also provides TypeScript definitions for type-safe development.
npm install @oramacloud/client
yarn add @oramacloud/client
pnpm i @oramacloud/client
bun i @oramacloud/client
Swift SDK
To install the Orama Cloud client in your Swift project, you’ll need to install CocoaPods and add the following line to your Podfile
.
source 'https://github.com/CocoaPods/Specs.git'platform :ios, '10.0'use_frameworks!
target '<Your Target Name>' do pod 'OramaCloudClient', '~> 0.0.1'end
Alternatively, you can use the Swift Package Manager by adding the following line to your Package.swift
:
dependencies: [ .package(url: "https://github.com/oramasearch/oramacloud-client-swift.git", from: "0.0.1")]
Kotlin SDK
To install the Orama Cloud multi-plataform client in your Kotlin project you need to enable mavenCentral
and include the dependency in your build.gradle.kts
:
repositories { mavenCentral()}
val oramaClientVersion = "0.0.3"
dependencies { implementation "com.orama:oramacloud-client-kotlin:${oramaClientVersion}"}
Python SDK
The Python SDK will be available soon. Stay tuned for updates!
PHP SDK
Install the PHP SDK using composer. The minimum version required is PHP 7.3.
composer require oramacloud/client
Usage
Once you have your SDK for your preferred language installed, you can start performing full-text, vector, and hybrid search queries on Orama Cloud.
The client exposes a simple search
method that can be used to query the index.
import { OramaClient } from "@oramacloud/client";
const client = new OramaClient({ endpoint: '<Your Orama Cloud Endpoint>', api_key: '<Your Orama Cloud API Key>',});
const results = await client.search({ term: "red shoes", mode: "fulltext", // optional, default is "fulltext" but can also be "vector" or "hybrid" where: { price: { gt: 99.99, }, },});
import OramaCloudClient
struct MyDoc: Codable { let title: String let description: String}
let clientParams = OramaClientParams(endpoint: "<Your Orama Cloud Endpoint>", apiKey: "<Your Orama Cloud API Key>")let client = OramaClient(params: clientParams)
let searchParams = ClientSearchParams.builder( term: "red shoes", mode: .fulltext // optional, default is .fulltext but can also be .vector or .hybrid ) .limit(10) // optional .offset(0) // optional .returning(["title", "description"]) // optional .build()
let searchResults: SearchResults<MyDoc> = try await client.search(query: searchParams)
import com.orama.client.OramaClientimport com.orama.model.search.*import kotlinx.serialization.Serializable
// Keep in mind that search is a suspended function,// so you need to call it from a coroutine ;)
@Serializabledata class MyDoc ( val title: String, val category: String, val path: String, val content: String, val section: String)
val searchParams = SearchParams.builder( term = "red shoes", mode = Mode.FULLTEXT ) .where(listOf( Condition("price", ConditionType.GreaterThan(99.99)) )) .build()
val results = client.search(searchParams, MyDoc.serializer())
print("coming soon")
use OramaCloud\Client;use OramaCloud\Client\Query;use OramaCloud\Client\QueryParams\WhereOperator;use OramaCloud\Client\QueryParams\SortByOrder;
$client = new Client([ 'endpoint' => '<Your Orama Cloud Endpoint>', 'api_key' => '<Your Orama Cloud API Key>']);
$query = (new Query()) ->term('red shoes') ->mode('fulltext') // 'fulltext' is optional, but can also be "vector" or "hybrid" ->where('price', WhereOperator::GT, 99.99);
$results = $client->search($query);
Next Steps
The SDKs provide a wide range of functionalities that allow you to interact with Orama Cloud programmatically. Here are some guides to help you get started: