From 1faa811ca320f087ee3e359859dde54a82b02926 Mon Sep 17 00:00:00 2001 From: Zeke Sikelianos Date: Tue, 28 Mar 2023 19:35:30 -0700 Subject: [PATCH] clean up making user agent optional --- README.md | 11 +++++------ index.d.ts | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 34c77e1..b23db39 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,6 @@ import Replicate from "replicate"; const replicate = new Replicate({ // get your token from https://replicate.com/account auth: process.env.REPLICATE_API_TOKEN, - userAgent: "my-app/1.2.3", }); ``` @@ -71,11 +70,11 @@ prediction = await replicate.wait(prediction); const replicate = new Replicate(options); ``` -| name | type | description | -| ------------------- | ------ | ---------------------------------------- | -| `options.auth` | string | **Required**. API access token | -| `options.userAgent` | string | **Required**. Identifier of your app | -| `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 | ### `replicate.models.get` diff --git a/index.d.ts b/index.d.ts index b6e343d..e845d66 100644 --- a/index.d.ts +++ b/index.d.ts @@ -3,7 +3,7 @@ type Identifier = `${string}/${string}:${string}`; declare module "replicate" { export interface ReplicateOptions { auth: string; - userAgent: string; + userAgent?: string; baseUrl?: string; }