aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-01-05 18:07:25 +0000
committerMohamed Bassem <me@mbassem.com>2025-01-05 18:07:25 +0000
commit26e22861399314644a253e407578c3358e19c3ae (patch)
tree01ed4aa77512ae76f54e35f85d529c4d52ad7339 /packages
parent838d30890a202ff522b4de45e97108a001311ce8 (diff)
downloadkarakeep-26e22861399314644a253e407578c3358e19c3ae.tar.zst
docs: Add readme to SDK
Diffstat (limited to 'packages')
-rw-r--r--packages/sdk/README.md57
1 files changed, 57 insertions, 0 deletions
diff --git a/packages/sdk/README.md b/packages/sdk/README.md
new file mode 100644
index 00000000..fbe1179b
--- /dev/null
+++ b/packages/sdk/README.md
@@ -0,0 +1,57 @@
+# Hoarder SDK
+
+This package contains the official typescript SDK for the hoarder API.
+
+## Installation
+
+```
+npm install @hoarderapp/sdk
+```
+
+## Usage
+
+```typescript
+import { createHoarderClient } from "@hoarderapp/sdk";
+
+// Create a client
+const apiKey = "my-super-secret-key";
+const client = createHoarderClient({
+ baseUrl: `http://localhost:${port}/api/v1/`,
+ headers: {
+ "Content-Type": "application/json",
+ authorization: `Bearer ${apiKey}`,
+ },
+});
+
+
+// Search for bookmarks
+const { data: searchResults, response: searchResponse } = await client.GET(
+ "/bookmarks/search",
+ {
+ params: {
+ query: {
+ q: "test bookmark",
+ },
+ },
+ },
+);
+
+// Create a bookmark
+await client.POST("/bookmarks", {
+ body: {
+ type: "text",
+ title: "Search Test 1",
+ text: "This is a test bookmark for search",
+ },
+});
+```
+
+
+## Docs
+
+API docs can be found [here](https://docs.hoarder.app/api).
+
+## Versioning
+
+- This package follows the minor version of the hoarder server. So new APIs introduced in Hoarder version `0.21.0` will be available in this package starting from version `0.21.0`.
+- Hoarder strives to maintain backward compatibility in its APIs, so older versions of this package should continue working with newer hoarder server versions.