aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/sdk/README.md38
-rw-r--r--packages/sdk/package.json2
2 files changed, 23 insertions, 17 deletions
diff --git a/packages/sdk/README.md b/packages/sdk/README.md
index 23948e37..5aad1847 100644
--- a/packages/sdk/README.md
+++ b/packages/sdk/README.md
@@ -15,7 +15,7 @@ import { createHoarderClient } from "@hoarderapp/sdk";
// Create a client
const apiKey = "my-super-secret-key";
-const addr = `https://hoarder.mydomain.com`;
+const addr = `https://hoarder.mydomain.com`;
const client = createHoarderClient({
baseUrl: `${addr}/api/v1/`,
headers: {
@@ -24,29 +24,35 @@ const client = createHoarderClient({
},
});
-
-// 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", {
+const {
+ data: createdBookmark,
+ response: createResponse,
+ error: createError,
+} = await client.POST("/bookmarks", {
body: {
type: "text",
title: "Search Test 1",
text: "This is a test bookmark for search",
},
});
-```
+console.log(createResponse.status, createdBookmark, createError);
+
+// Search for bookmarks
+const {
+ data: searchResults,
+ response: searchResponse,
+ error: searchError,
+} = await client.GET("/bookmarks/search", {
+ params: {
+ query: {
+ q: "test bookmark",
+ },
+ },
+});
+console.log(searchResponse.status, searchResults, searchError);
+```
## Docs
diff --git a/packages/sdk/package.json b/packages/sdk/package.json
index b61e95d6..5d11cc9c 100644
--- a/packages/sdk/package.json
+++ b/packages/sdk/package.json
@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@hoarderapp/sdk",
- "version": "0.21.1",
+ "version": "0.21.2",
"description": "Typescript SDK for Hoarder",
"license": "GNU Affero General Public License version 3",
"keywords": [