Skip to content

Commit

Permalink
@uppy/transloadit: add clientName option (#4920)
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Feb 19, 2024
1 parent a507d2e commit 7b492d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/@uppy/transloadit/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default class Transloadit extends BasePlugin {
getAssemblyOptions: null,
limit: 20,
retryDelays: [7_000, 10_000, 15_000, 20_000],
clientName: null,
}

this.opts = { ...defaultOptions, ...opts }
Expand Down Expand Up @@ -126,6 +127,10 @@ export default class Transloadit extends BasePlugin {
addPluginVersion('Zoom', 'uppy-zoom')
addPluginVersion('Url', 'uppy-url')

if (this.opts.clientName != null) {
list.push(this.opts.clientName)
}

return list.join(',')
}

Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/transloadit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ interface Options extends PluginOptions {
alwaysRunAssembly?: boolean
locale?: TransloaditLocale
limit?: number
clientName?: string
}

export type TransloaditOptions = Options &
Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/transloadit/types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const validParams = {
waitForEncoding: false,
waitForMetadata: true,
importFromUploadURLs: false,
clientName: 'my-application',
})
// Access to both transloadit events and core events
uppy.on('transloadit:assembly-created', (assembly) => {
Expand Down

0 comments on commit 7b492d7

Please sign in to comment.