allow passing api key as env var (#841)

Allow passing API key as env var:
```shell
export LANCEDB_API_KEY=sh_123...
```

with this set, apiKey argument can omitted from `connect`
```js
    const db = await vectordb.connect({
        uri: "db://test-proj-01-ae8343",
        region: "us-east-1",
  })
```
```py
    db = lancedb.connect(
        uri="db://test-proj-01-ae8343",
        region="us-east-1",
    )
```
This commit is contained in:
Bert
2024-01-22 16:18:28 -05:00
committed by Weston Pace
parent d8befeeea2
commit a409000c6f
3 changed files with 15 additions and 2 deletions

View File

@@ -78,7 +78,11 @@ export interface ConnectionOptions {
/** AWS region to connect to. Default is {@link defaultAwsRegion}. */
awsRegion?: string
// API key for the remote connections
/**
* API key for the remote connections
*
* Can also be passed by setting environment variable `LANCEDB_API_KEY`
*/
apiKey?: string
/** Region to connect */