Skip to content

Commit 7f1d78a

Browse files
committed
Update README
1 parent 4aa3561 commit 7f1d78a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Create the client:
2626
import Replicate from "replicate";
2727

2828
const replicate = new Replicate({
29-
// get your token from https://replicate.com/account
30-
auth: process.env.REPLICATE_API_TOKEN,
29+
auth: "my api token", // defaults to process.env.REPLICATE_API_TOKEN
3130
});
3231
```
3332

@@ -124,18 +123,14 @@ and pass it to the `fetch` option in the constructor.
124123
import Replicate from "replicate";
125124
import fetch from "cross-fetch";
126125

127-
const replicate = new Replicate({
128-
// get your token from https://replicate.com/account
129-
auth: process.env.REPLICATE_API_TOKEN,
130-
fetch: fetch,
131-
});
126+
const replicate = new Replicate({ fetch });
132127
```
133128

134129
You can override the `fetch` property to add custom behavior to client requests,
135130
such as injecting headers or adding log statements.
136131

137132
```js
138-
client.fetch = (url, options) => {
133+
replicate.fetch = (url, options) => {
139134
const headers = new Headers(options && options.headers);
140135
headers.append("X-Custom-Header", "some value");
141136

0 commit comments

Comments
 (0)