Skip to content

Commit b54f0f2

Browse files
authored
clean up making user agent optional (#28)
1 parent ef03afa commit b54f0f2

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import Replicate from "replicate";
2020
const replicate = new Replicate({
2121
// get your token from https://replicate.com/account
2222
auth: process.env.REPLICATE_API_TOKEN,
23-
userAgent: "my-app/1.2.3",
2423
});
2524
```
2625

@@ -71,11 +70,11 @@ prediction = await replicate.wait(prediction);
7170
const replicate = new Replicate(options);
7271
```
7372

74-
| name | type | description |
75-
| ------------------- | ------ | ---------------------------------------- |
76-
| `options.auth` | string | **Required**. API access token |
77-
| `options.userAgent` | string | **Required**. Identifier of your app |
78-
| `options.baseUrl` | string | Defaults to https://api.replicate.com/v1 |
73+
| name | type | description |
74+
| ------------------- | ------ | --------------------------------------------------------------------------------- |
75+
| `options.auth` | string | **Required**. API access token |
76+
| `options.userAgent` | string | Identifier of your app. Defaults to `replicate-javascript/${packageJSON.version}` |
77+
| `options.baseUrl` | string | Defaults to https://api.replicate.com/v1 |
7978

8079
### `replicate.models.get`
8180

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type Identifier = `${string}/${string}:${string}`;
33
declare module "replicate" {
44
export interface ReplicateOptions {
55
auth: string;
6-
userAgent: string;
6+
userAgent?: string;
77
baseUrl?: string;
88
}
99

0 commit comments

Comments
 (0)