@@ -136,7 +136,7 @@ composer require codewithkyrian/chromadb-php
136136``` php
137137use Codewithkyrian\ChromaDB\ChromaDB;
138138
139- $chromaDB = ChromaDB::client();
139+ $chroma = ChromaDB::client();
140140
141141```
142142
@@ -147,7 +147,7 @@ factory method:
147147``` php
148148use Codewithkyrian\ChromaDB\ChromaDB;
149149
150- $chromaDB = ChromaDB::factory()
150+ $chroma = ChromaDB::factory()
151151 ->withHost('http://localhost')
152152 ->withPort(8000)
153153 ->withDatabase('new_database')
@@ -157,6 +157,47 @@ $chromaDB = ChromaDB::factory()
157157
158158If the tenant or database doesn't exist, the package will automatically create them for you.
159159
160+ ### Authentication
161+
162+ ChromaDB supports static token-based authentication. To use it, you need to start the Chroma server passing the required
163+ environment variables as stated in the documentation. If you're using the docker image, you can pass in the environment
164+ variables using the ` --env ` flag or by using a ` .env ` file and for the docker-compose file, you can use the ` env_file `
165+ option, or pass in the environment variables directly like so:
166+
167+ ``` yaml
168+ version : ' 3.9'
169+
170+ services :
171+ chroma :
172+ image : ' chromadb/chroma'
173+ ports :
174+ - ' 8000:8000'
175+ environment :
176+ - CHROMA_SERVER_AUTH_CREDENTIALS=test-token
177+ - CHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER=chromadb.auth.token.TokenConfigServerAuthCredentialsProvider
178+ - CHROMA_SERVER_AUTH_PROVIDER=chromadb.auth.token.TokenAuthServerProvider
179+
180+ ...
181+ ```
182+
183+ You can then connect to ChromaDB using the factory method:
184+
185+ ``` php
186+ use Codewithkyrian\ChromaDB\ChromaDB;
187+
188+ $chroma = ChromaDB::factory()
189+ ->withAuthToken('test-token')
190+ ->connect();
191+ ```
192+
193+ ### Getting the version
194+
195+ ``` php
196+
197+ echo $chroma->version(); // 0.4.0
198+
199+ ```
200+
160201### Creating a Collection
161202
162203Creating a collection is as simple as calling the ` createCollection ` method on the client and passing in the name of
0 commit comments