Skip to content

Commit

Permalink
release(sdk): Re-release the 0.21 sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedBassem committed Jan 5, 2025
1 parent 7868e76 commit 0cea051
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
38 changes: 22 additions & 16 deletions packages/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit 0cea051

Please sign in to comment.