Skip to content

Commit 4bf9d17

Browse files
committed
feat: add config option to override user agent
1 parent 35af25b commit 4bf9d17

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/client.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export class ConversionToolsClient {
5858
maxPollingInterval: config.maxPollingInterval || 30000,
5959
pollingBackoff: config.pollingBackoff || 1.5,
6060
webhookUrl: config.webhookUrl,
61+
userAgent: config.userAgent || `conversiontools-node/${VERSION}`,
6162
onUploadProgress: config.onUploadProgress,
6263
onDownloadProgress: config.onDownloadProgress,
6364
onConversionProgress: config.onConversionProgress,
@@ -71,7 +72,7 @@ export class ConversionToolsClient {
7172
retries: this.config.retries,
7273
retryDelay: this.config.retryDelay,
7374
retryableStatuses: this.config.retryableStatuses,
74-
userAgent: `conversiontools-node/${VERSION}`,
75+
userAgent: this.config.userAgent,
7576
});
7677

7778
// Initialize API clients

src/types/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ export interface ConversionToolsConfig {
3737
/** Webhook URL for task completion notifications */
3838
webhookUrl?: string;
3939

40+
/** UserAgent string for HTTP requests */
41+
userAgent?: string;
42+
4043
/** Upload progress callback */
4144
onUploadProgress?: (progress: ProgressEvent) => void;
4245

0 commit comments

Comments
 (0)