@@ -751,13 +751,13 @@ You can configure Chroma to use authentication when in server/client mode only.
751751
752752Supported authentication methods:
753753
754- | Authentication Method | Basic Auth (Pre-emptive) | Static API Token |
755- | -----------------------| ---------------------------------------------------------------------------------------------------------------------------| ----------------------------------------------------------------------------------------------- |
756- | 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.|
757- | Status | ` Alpha ` | ` Alpha ` |
754+ | Authentication Method | Basic Auth (Pre-emptive) | Static API Token |
755+ | -----------------------| ---------------------------------------------------------------------------------------------------------------------------| ----------------------------------------------------------------------------------------------|
756+ | 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. |
757+ | Status | ` Alpha ` | ` Alpha ` |
758758| Server-Side Support | ✅ ` Alpha ` | ✅ ` Alpha ` |
759- | Client/Python | ✅ | ✅ |
760- | Client/JS | ✅ | ➖ |
759+ | Client/Python | ✅ ` Alpha ` | ✅ ` Alpha ` |
760+ | Client/JS | ✅ ` Alpha ` | ✅ ` Alpha ` |
761761
762762### Basic Authentication
763763
@@ -868,8 +868,25 @@ client.list_collections() # this is a protected endpoint and requires authentic
868868</TabItem >
869869<TabItem value =" js " label =" JavaScript " >
870870
871- :::info Not Available
872- Authentication is not yet supported in JS
873- :::
871+ #### Client Setup
872+
873+ Using the default ` Authorization: Bearer <token> ` header:
874+
875+ ``` js
876+ import { ChromaClient } from ' chromadb'
877+
878+ const client = new ChromaClient ({auth: {provider: " token" , credentials: " test-token" }});
879+ // or explicitly specifying the auth header type
880+ const client = new ChromaClient ({auth: {provider: " token" , credentials: " test-token" , providerOptions: {headerType: " AUTHORIZATION" }}});
881+ ```
882+
883+ Using custom Chroma auth token ` X-Chroma-Token: <token> ` header:
884+
885+ ``` js
886+ import { ChromaClient } from ' chromadb'
887+
888+ const client = new ChromaClient ({auth: {provider: " token" , credentials: " test-token" , providerOptions: {headerType: " X_CHROMA_TOKEN" }}});
889+ ```
890+
874891</TabItem >
875892</Tabs >
0 commit comments