
Offers a versatile SDK for interacting with Objective API, featuring CLI/TUI options, async client methods, and cross-platform integration for seamless data retrieval and manipulation.
Clone this repository to run the CLI / TUI or install with Homebrew.
# Set your API key
export OBJECTIVE_KEY=sk_...
# Install with homebrew
brew install hbmartin/objective/objective
# Checklist of commands
objective -h
# To start the interactive TUI
objective
# Optional alias
alias obj="objective"
echo 'alias obj="objective"' >> ~/.zshrc(To add the dependency to non-Gradle projects see the snippets on Maven Central.)
implementation("me.haroldmartin:objective-sdk:0.3.2")If Gradle cannot find the Objective artifact then check that mavenCentral() is in your repositories.
import me.haroldmartin.objective.ObjectiveClient
// To get your API key, sign up at https://objective.ai and paste it below
val objectiveKey = "sk_qwerty"
// To retrieve your key from an environment variable, use:
// val objectiveKey = System.getenv("OBJECTIVE_KEY")
val client = ObjectiveClient(objectiveKey)import kotlinx.serialization.json.JsonObject
// Note that the generic can be any @Serializable object
// https://ktor.io/docs/client-serialization.html#receive_send_data
// It is strongly suggested you use nullable types to avoid deserialization errors
val obj = client.getObject<JsonObject>("objectId")ObjectiveClient methods are suspending (async) and so require the explicit use of continuations in Java.
For an example see this Spring Boot demo.
This library is compatible with Kotlin Multiplatform and can be used in iOS projects. The client methods can either be called as async methods or using completion handlers. To call it from Swift, use the following:
let client = ObjectiveClientInit.shared.withKey(apiKey: "sk_DVkOBubJN3lr")
client.getIndexes { indexes, error in
if error != nil {
print("failed to getObjects: \(error)")
}
if let indexes {
...
}
}All of the client calls available are documented here and the model used in responses are documented for index calls and object calls.
git clone git@github.com:hbmartin/objective-sdk-kotlin-multiplatform.git, then open it in IntelliJ and run the tests.Clone this repository to run the CLI / TUI or install with Homebrew.
# Set your API key
export OBJECTIVE_KEY=sk_...
# Install with homebrew
brew install hbmartin/objective/objective
# Checklist of commands
objective -h
# To start the interactive TUI
objective
# Optional alias
alias obj="objective"
echo 'alias obj="objective"' >> ~/.zshrc(To add the dependency to non-Gradle projects see the snippets on Maven Central.)
implementation("me.haroldmartin:objective-sdk:0.3.2")If Gradle cannot find the Objective artifact then check that mavenCentral() is in your repositories.
import me.haroldmartin.objective.ObjectiveClient
// To get your API key, sign up at https://objective.ai and paste it below
val objectiveKey = "sk_qwerty"
// To retrieve your key from an environment variable, use:
// val objectiveKey = System.getenv("OBJECTIVE_KEY")
val client = ObjectiveClient(objectiveKey)import kotlinx.serialization.json.JsonObject
// Note that the generic can be any @Serializable object
// https://ktor.io/docs/client-serialization.html#receive_send_data
// It is strongly suggested you use nullable types to avoid deserialization errors
val obj = client.getObject<JsonObject>("objectId")ObjectiveClient methods are suspending (async) and so require the explicit use of continuations in Java.
For an example see this Spring Boot demo.
This library is compatible with Kotlin Multiplatform and can be used in iOS projects. The client methods can either be called as async methods or using completion handlers. To call it from Swift, use the following:
let client = ObjectiveClientInit.shared.withKey(apiKey: "sk_DVkOBubJN3lr")
client.getIndexes { indexes, error in
if error != nil {
print("failed to getObjects: \(error)")
}
if let indexes {
...
}
}All of the client calls available are documented here and the model used in responses are documented for index calls and object calls.
git clone git@github.com:hbmartin/objective-sdk-kotlin-multiplatform.git, then open it in IntelliJ and run the tests.