Skip to content

Commit e7f3d5f

Browse files
authored
Kg nextjs example readme update (#48)
* updated code sample in nextjs readme
1 parent eb3d244 commit e7f3d5f

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

examples/nextjs/README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,13 @@ in the main `README.md` for more information common between non-standard environ
4646
```ts
4747
import { DataAPIClient } from '@datastax/astra-db-ts';
4848

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!);
5453
const db = client.db(process.env.ASTRA_DB_ENDPOINT!);
5554

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.
5956
// export const runtime = 'edge';
6057

6158
// Simple example which (attempts to) list all the collections in the database

0 commit comments

Comments
 (0)