Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix quickstart code and add SDK references to sidebar #68

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions docs/getting-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ app = client.apps.get_or_create(
```

```javascript NodeJS
const app = await honcho.apps.getOrCreate({ name: 'string' });
const app = await honcho.apps.getOrCreate("Example");
```

</CodeGroup>
Expand All @@ -71,7 +71,7 @@ user = honcho.apps.users.create(app_id=app.id, name="User")
```

```javascript NodeJS
const user = honcho.apps.users.create(app.id, {name: "User" })
const user = await honcho.apps.users.create(app.id, { name: "User" });
```

</CodeGroup>
Expand All @@ -85,7 +85,9 @@ session = client.apps.users.sessions.create(user.id, app.id, location_id=default
```

```javascript NodeJS
const session = client.apps.users.sessions.create(app.id, user.id, { location_id: "default"}) -> Session
const session = await honcho.apps.users.sessions.create(app.id, user.id, {
metadata: { location_id: "default" },
});
```

</CodeGroup>
Expand All @@ -99,7 +101,10 @@ client.apps.users.sessions.messages.create(session.id, app.id, user.id, content=
```

```javascript NodeJS
client.apps.users.sessions.messages.create(app.id, user.id, session.id, { content: "Test", is_user: true })
honcho.apps.users.sessions.messages.create(app.id, user.id, session.id, {
content: "Test",
is_user: true,
});
```

</CodeGroup>
Expand All @@ -124,4 +129,7 @@ for await (const session of honcho.apps.users.sessions.list(app.id, user.id)) {

This is a super simple overview of how to get up and running with the Honcho SDK. We covered the basic methods for reading and writing from the hosted storage service. Next, we'll cover alternative forms of hosting Honcho.

For a more detailed look at the SDK check out the SDK reference [here](https://api.python.honcho.dev/).
For a more detailed look at the SDK, check out the SDK references:

- [Honcho Python SDK](https://github.com/plastic-labs/honcho-python/blob/main/api.md)
- [Honcho NodeJS SDK](https://github.com/plastic-labs/honcho-node/blob/main/api.md)
7 changes: 7 additions & 0 deletions docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
"getting-started/architecture"
]
},
{
"group": "SDK Reference",
"pages": [
"sdk-reference/python-sdk",
"sdk-reference/nodejs-sdk"
]
},
{
"group": "Contributing",
"pages": [
Expand Down
4 changes: 4 additions & 0 deletions docs/sdk-reference/nodejs-sdk.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "NodeJS SDK"
url: "https://github.com/plastic-labs/honcho-node/blob/main/api.md"
---
4 changes: 4 additions & 0 deletions docs/sdk-reference/python-sdk.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: "Python SDK"
url: "https://github.com/plastic-labs/honcho-python/blob/main/api.md"
---