From 02ad4bf7b444a5f50853497388f1d35a6291df65 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Fri, 21 Apr 2023 04:45:06 -0700 Subject: [PATCH] Document constructor fetch option --- README.md | 11 ++++++----- index.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3b40f38d..f8878e77 100644 --- a/README.md +++ b/README.md @@ -65,11 +65,12 @@ console.log(prediction.output) const replicate = new Replicate(options); ``` -| name | type | description | -| ------------------- | ------ | --------------------------------------------------------------------------------- | -| `options.auth` | string | **Required**. API access token | -| `options.userAgent` | string | Identifier of your app. Defaults to `replicate-javascript/${packageJSON.version}` | -| `options.baseUrl` | string | Defaults to https://api.replicate.com/v1 | +| name | type | description | +| ------------------- | -------- | --------------------------------------------------------------------------------- | +| `options.auth` | string | **Required**. API access token | +| `options.userAgent` | string | Identifier of your app. Defaults to `replicate-javascript/${packageJSON.version}` | +| `options.baseUrl` | string | Defaults to https://api.replicate.com/v1 | +| `options.fetch` | function | Fetch function to use. Defaults to `globalThis.fetch` | ### `replicate.models.get` diff --git a/index.js b/index.js index edaa67ce..5f033a2d 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,7 @@ class Replicate { * @param {string} options.auth - Required. API access token * @param {string} options.userAgent - Identifier of your app * @param {string} [options.baseUrl] - Defaults to https://api.replicate.com/v1 - * @param {Function} [options.fetch] - Defaults to native fetch + * @param {Function} [options.fetch] - Fetch function to use. Defaults to `globalThis.fetch` */ constructor(options) { this.auth = options.auth;