Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit b3246bf

Browse files
authored
Merge pull request #123 from amikos-tech/feature/1026-js-auth-docs
[DOC]: Updated JS Client docs with auth config.
2 parents 8d1e6b9 + 3eba886 commit b3246bf

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

docs/usage-guide.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -721,18 +721,15 @@ You can configure Chroma to use authentication when in server/client mode only.
721721
Supported authentication methods:
722722

723723
| Authentication Method | Basic Auth (Pre-emptive) | Static API Token |
724-
|-----------------------|---------------------------------------------------------------------------------------------------------------------------|------------------|
725-
| Description | [RFC 7617](https://www.rfc-editor.org/rfc/rfc7617) Basic Auth with `user:password` base64-encoded `Authorization` header. | |
726-
| Status | `Alpha` | |
727-
| Server-Side Support |`Alpha` |`Alpha` |
728-
| Client/Python || |
729-
| Client/JS | ||
724+
|-----------------------|---------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
725+
| Description | [RFC 7617](https://www.rfc-editor.org/rfc/rfc7617) Basic Auth with `user:password` base64-encoded `Authorization` header. | Static auth token in `Authorization: Bearer <tokem>` or in `X-Chroma-Token: <token>` headers.|
726+
| Status | `Alpha` | `Alpha` |
727+
| Server-Side Support |`Alpha` |`Alpha` |
728+
| Client/Python || |
729+
| Client/JS | | |
730730

731731
### Basic Authentication
732732

733-
<Tabs queryString groupId="lang" className="hideTabSwitcher">
734-
<TabItem value="py" label="Python">
735-
736733
#### Server Setup
737734

738735
##### Generate Server-Side Credentials
@@ -759,6 +756,9 @@ CHROMA_SERVER_AUTH_PROVIDER="chromadb.auth.basic.BasicAuthServerProvider"
759756
docker-compose --env-file ./.chroma_env up -d --build
760757
```
761758

759+
<Tabs queryString groupId="lang" className="hideTabSwitcher">
760+
<TabItem value="py" label="Python">
761+
762762
#### Client Setup
763763

764764
```python
@@ -777,9 +777,14 @@ client.list_collections() # this is a protected endpoint and requires authentic
777777
</TabItem>
778778
<TabItem value="js" label="JavaScript">
779779

780-
:::info Not Available
781-
Authentication is not yet supported in JS
782-
:::
780+
#### Client Setup
781+
782+
```js
783+
import { ChromaClient } from 'chromadb'
784+
785+
const client = new ChromaClient({auth: {provider: "basic", credentials: "admin:admin"}});
786+
```
787+
783788
</TabItem>
784789
</Tabs>
785790

0 commit comments

Comments
 (0)