File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -46,16 +46,13 @@ in the main `README.md` for more information common between non-standard environ
46
46
``` ts
47
47
import { DataAPIClient } from ' @datastax/astra-db-ts' ;
48
48
49
- // Creates the client with the `httpOptions` set to use the `fetch` client as next.js's minification
50
- // conflicts with the importing of our default http client (see http2-when-minified for more info)
51
- const client = new DataAPIClient (process .env .ASTRA_DB_TOKEN ! , {
52
- httpOptions: { client: ' fetch' },
53
- });
49
+ // Creates the client. Because the code is minified (when ran), astra-db-ts will default to using
50
+ // `fetch` as the HTTP client. If you need HTTP/2, please see `examples/http2-when-minified` for more
51
+ // information on how to use HTTP/2 with Next.js
52
+ const client = new DataAPIClient (process .env .ASTRA_DB_TOKEN ! );
54
53
const db = client .db (process .env .ASTRA_DB_ENDPOINT ! );
55
54
56
- // If `runtime` is set to `edge`, you could get away without needing to specify the specific
57
- // client, as `astra-db-ts` would be able to infer that it should use `fetch` for you.
58
- // e.g. `const client = new DataAPIClient(process.env.ASTRA_DB_TOKEN!);`
55
+ // You may use the edge runtime as normal as well. HTTP/2 is not supported here, at all.
59
56
// export const runtime = 'edge';
60
57
61
58
// Simple example which (attempts to) list all the collections in the database
You can’t perform that action at this time.
0 commit comments