Repository navigation
Releases
Releases · DeepL/deepl-node
v1.29.0
TL;DR: new APIs in this release: the Admin API, spoken terms, style profiles and text correction.
Translation memories, style rules and multilingual glossaries gained many options and fixes.
Read Changed and Deprecated before upgrading; no public API is removed in this release.
Added
DocumentTranslationErrorcopieshttpStatusCodeandshouldRetryfrom its
cause when the cause is aDeepLError.- Added
waitUntilTranslationMemoryJobDone(), which replaces
isTranslationMemoryJobComplete(). It accepts the job as an ID or a
TranslationMemoryJob, andWaitOptionsor the timeout in milliseconds, and
rejects with the job's error message if the job fails or expires.
getTranslationMemoryJob()also accepts aTranslationMemoryJob. - Added
result,status,done()andok()toTranslationMemoryJob:
the single entry ofresults, its status, whether the job completed, and
whether it has not failed or expired.done()andok()are optional members
of the type, so objects built without them still compile;done()is also true
for the deprecated'downloaded'status. - Added the
CreateTranslationMemoryImportOptionsand
ImportTranslationMemoryOptionstypes, withextraBodyParametersmerged last
into the import request body. importTranslationMemoryFromFilepath()accepts aBufferorReadStream, with
the newfileNameoption (ordisplayName) as the file name.isTranslationMemoryJobComplete()also acceptsWaitOptions.- The style rule methods
getStyleRule(),updateStyleRuleName(),
updateStyleRuleConfiguredRules(),deleteStyleRule()and the four custom
instruction methods accept the style rule as an ID or aStyleRuleInfo
object.getStyleRuleCustomInstruction(),updateStyleRuleCustomInstruction()
anddeleteStyleRuleCustomInstruction()accept the custom instruction as an
ID or aCustomInstructionobject. - Added an optional last
optionsargument withextraBodyParametersto
createStyleRule(),updateStyleRuleName(),updateStyleRuleConfiguredRules(),
createStyleRuleCustomInstruction()andupdateStyleRuleCustomInstruction()
(typesCreateStyleRuleOptions,UpdateStyleRuleNameOptions,
UpdateStyleRuleConfiguredRulesOptions,CreateStyleRuleCustomInstructionOptions
andUpdateStyleRuleCustomInstructionOptions). - Added
translateDocumentUpload(),translateDocumentGetStatus()and
translateDocumentDownload(), which replaceuploadDocument(),
getDocumentStatus()anddownloadDocument()and behave the same. - Added
documentIdtoDocumentStatus, parsed fromdocument_id;undefined
when the response does not contain it. - Added the
timeoutMsoption toDocumentTranslateOptions: the maximum time
translateDocument()waits for the translation between upload and download.
When it expires,translateDocument()rejects with aDocumentTranslationError. - Added the
WaitOptionstype withtimeoutMs. - Added
tagHandlingVersiontoTextResult: the tag handling version used, parsed
from the response;undefinedwhen the API does not return it. SentenceSplittingModeaccepts'1'and'0', the API values, which are sent
unchanged.- Added the
extraBodyParametersoption toBaseRequestOptions, and so to
TranslateTextOptions,DocumentTranslateOptions,RephraseTextOptionsand
CorrectTextOptions.
It replacesextraRequestParametersand behaves the same. Passing both
throwsArgumentError. - Added
NotFoundError, thrown when the API answers HTTP 404 on any endpoint.
GlossaryNotFoundErrornow extends it. - Added
httpStatusCodetoDeepLError: the HTTP status code of the failed
response, orundefinedif there was no HTTP response. - Added
shouldRetrytoDeepLError(previously only onConnectionError):
true for HTTP 429, 5xx and transient network failures. For
DeepLAdminClient.createDeveloperKey()it is true only when the request was
not processed (HTTP 429, DNS failures and refused connections). isFreeAccountAuthKey()is exported from the package root.- Added the
styleProfileoption toTranslateTextOptionsand
DocumentTranslateOptionsto translate text and documents with a style
profile, given as its ID or aStyleProfileobject. It is sent as
style_profile_id. - Added style profiles (
/v3/style_profiles) toDeepLClient:
listStyleProfiles(),createStyleProfile(),getStyleProfile(),
updateStyleProfile()anddeleteStyleProfile(). Added theStyleProfile,
CreateStyleProfileOptionsandUpdateStyleProfileOptionstypes. The
options acceptextraBodyParameters, and the linked glossaries, style rule
lists and translation memories as IDs or objects; the options of
updateStyleProfile()are optional. - Added spoken terms collections (
/v3/spoken-terms) toDeepLClient:
createSpokenTerms(),listSpokenTerms(),getSpokenTerms(),
updateSpokenTerms(),getSpokenTermsEntries(),replaceSpokenTermsList(),
deleteSpokenTerms()anddeleteSpokenTermsList(). Added theSpokenTerms,
SpokenTermsListandSpokenTermsEntriestypes, and the
CreateSpokenTermsOptions,UpdateSpokenTermsOptionsand
ReplaceSpokenTermsListOptionstypes, which acceptextraBodyParameters.
The options ofupdateSpokenTerms()are optional; without them an empty body
is sent. Terms are trimmed, then checked and sent trimmed. - Added the API Pro fields of
GET /v2/usagetoUsage:apiKeyCharacter,
speechToTextMinutesandspeechToSpeechMinutes(UsageDetail),products
(array of the newUsageProducttype), andstartTimeandendTime
(Date). They areundefinedwhen the response does not contain them, as
are theUsageProductfields missing from aproductsentry.
anyLimitReached()still checks only the character, document and team
document usage. - Added the
DeepLAdminClientclass for the Admin API. It must be created with
an admin API key and supports managing developer keys
(createDeveloperKey(),listDeveloperKeys(),deactivateDeveloperKey(),
renameDeveloperKey(),setDeveloperKeyUsageLimits()) and retrieving usage
analytics (getUsageAnalytics(startDate, endDate, groupBy?),
getCustomTagUsageAnalytics(startDate, endDate, aggregateBy?, page?)). Added
theHttpClientOptions,DeepLAdminClientOptions,DeveloperKey,
DeveloperKeyUsageLimits,DeveloperKeyUsageLimitsUpdate,AdminUsageReport,
AdminUsageBreakdown,KeyUsage,AdminUsageGroupBy,CustomTagUsageReport,
CustomTagUsage,CustomTagUsageBreakdownandCustomTagUsageAggregateBy
types;AdminUsageGroupByandCustomTagUsageAggregateByalso accept any
other string, which is sent unchanged. The developer key methods take a
trailing options argument (CreateDeveloperKeyOptionswithlabel,
DeactivateDeveloperKeyOptions,RenameDeveloperKeyOptions,
SetDeveloperKeyUsageLimitsOptions) that acceptsextraBodyParameters.
AdminUsageBreakdownincludesspeechToSpeechMinutes.
DeveloperKey.label,DeveloperKey.usageLimits,KeyUsage.apiKeyLabel,
AdminUsageBreakdown.speechToSpeechMinutes,
CustomTagUsageBreakdown.speechToSpeechMinutes,AdminUsageReport.totalUsage
andstartDateandendDateof both reports are optional andundefined
when the response does not contain them, never0, an all-zero breakdown or
an invalidDate. Report dates areDates at UTC midnight. - Added
getLanguageResources()toDeepLClient, which retrieves the resources
supported by the DeepL API and, for each feature, whether the source and/or
target language must support it. Added theLanguageResourceand
ResourceFeaturetypes.
ResourceFeature.needsSourceSupportandneedsTargetSupportareboolean
and[secure]when the API omits them. - Added
getLanguagesForResource()toDeepLClient, which retrieves the languages supported
by a DeepL API resource (GET /v3/languages), whether each is usable as source
and/or target language, and the features it supports. The optionalinclude
option adds beta languages and features, or features relying on third-party
providers. Added theLanguageSupport,LanguageFeature,
LanguageResourceName,LanguageIncludeandGetLanguagesForResourceOptionstypes.
LanguageResourceNameandLanguageIncludeaccept any string in addition to
their listed values, which is sent unchanged. - Added
correctText()toDeepLClient, which corrects grammar, spelling and punctuation
of a string or an array of strings viaPOST /v2/write/correct. Takes an optional
target language and an optionalCorrectTextOptionsobject (BaseRequestOptions, so
extraBodyParameters), and returnsWriteResultobjects, likerephraseText(). - Added the
outputFormatoption toDocumentTranslateOptions, which requests the file
format of the translated document, for example'docx'. By default the translated
document has the same format as the input document. - Added the
enableWatermarkoption toDocumentTranslateOptions, which adds a
"Translated by DeepL" watermark to the translated document. Only supported for
docxandpdfoutput. - Added
translateDocumentWaitUntilDone(), which polls a document translation
until it is done and resolves with the finalDocumentStatus, or rejects with
aDeepLErrorif the translation fails. Its optional second argument
(WaitOptions) takestimeoutMs, after which it rejects with aDeepLError. - Added the
RephraseTextOptionstype withwritingStyleandtone. It
extendsBaseRequestOptions, so it also acceptsextraBodyParameters,
which are added to the request body and override parameters of the same
name.rephraseText()accepts it as its third argument. createStyleRule()accepts the name, language, configured rules and custom
instructions as separate arguments:
`createStyleRule(name, language, configu...
v1.28.1
Security
- Bumped
axiosto^1.20.0andadm-zipto^0.6.1to resolve
high-severity npm audit advisories in production dependencies.
v1.28.0
Added
- Added support for using multiple glossaries in text and document translation
via theglossaryIdsoption (up to 5 glossary IDs) inTranslateTextOptions
andDocumentTranslateOptions. - Added support for style rules in document translation via the
styleRule
option inDocumentTranslateOptions. - Added support for translation memories in document translation via the
translationMemoryandtranslationMemoryThresholdoptions in
DocumentTranslateOptions. - Added support for the translation memory management APIs:
getTranslationMemory(),listTranslationMemorySegments(),
deleteTranslationMemory(),createTranslationMemoryImport(),
uploadTranslationMemoryFile(),createTranslationMemoryExport(),
getTranslationMemoryJob(),isTranslationMemoryJobComplete(), and
downloadTranslationMemoryExport(), along with the
importTranslationMemoryFromFilepath()and
exportTranslationMemoryToFilepath()convenience functions that create the
job, transfer the TMX file, and wait for the job to finish. Because the API
detects the file upload asynchronously, an import job keeps reporting
awaiting_inputfor a while after the upload; the wait loop polls through
that status and accepts an optionaltimeoutMsto bound the wait. - Added the
TranslationMemorySegments,TranslationMemorySegment,
TranslationMemoryTargetSegment,TranslationMemorySegmentsOptions,
TranslationMemoryImport,TranslationMemoryExport,TranslationMemoryJob,
TranslationMemoryJobResult, andTranslationMemoryJobStatustypes. - Added optional
creationTimeandupdatedTimefields to
TranslationMemoryInfo.
Changed
- Requests to the pre-signed storage URLs used for translation memory import and export now
go through a separate HTTP client that is constructed without the DeepLAuthorization
header, instead of stripping it per request. Headers supplied viaTranslatorOptions.headers
are no longer sent to those URLs either — only theUser-Agentand the per-request
Content-Type. Proxy settings are unaffected.
Fixed
- The debug log helper no longer crashes when axios error fields return a non-primitive from
toStringorSymbol.toPrimitive.
Security
- Bumped
axiosto^1.19.0,form-datato^3.0.5, andadm-zipto
^0.6.0to resolve high-severity npm audit advisories in production
dependencies.
v1.26.0
Added
- Added support for translation memories in text translation via
translationMemoryandtranslationMemoryThresholdoptions in
translateText(). - Added
listTranslationMemories()method to theDeepLClientclass for
listing available translation memories.
Changed
- Bumped
axiosdependency due to CVE-2025-62718
Fixed
- Fix write tests that broke from language expansion
v1.25.0
Added
- Added new language constants from January 2026 API release of 81 new languages.
- Added
jsonBodyoption toSendRequestOptions, enabling JSON-encoded API calls. - Added support for style rules CRUD endpoints in the
DeepLClientclass:createStyleRule(),getStyleRule(),updateStyleRuleName(),updateStyleRuleConfiguredRules(), anddeleteStyleRule(). - Added support for style rule custom instruction CRUD endpoints in the
DeepLClientclass:createStyleRuleCustomInstruction(),getStyleRuleCustomInstruction(),updateStyleRuleCustomInstruction(), anddeleteStyleRuleCustomInstruction().
Please refer to the README for usage instructions.
v1.24.0
Added
- Added
tagHandlingVersionparameter totranslateText()to specify which version of the tag handling algorithm to use. Options arev1andv2.
v1.23.0
Added
- Added
customInstructionsparameter totranslateText()to customize translation behavior with up to 10 instructions (max 300 characters each). Only supported for target languages:de,en,es,fr,it,ja,ko,zhand their variants. Note: using thecustomInstructionsparameter will usequality_optimizedmodel type as the default. Requests combiningcustomInstructionsand thelatency_optimizedmodel type will be rejected.
v1.22.0
Added
- Added support for the
GET /v3/style_rulesendpoint in the client library, the implementation can be found in theDeepLClientclass. Please refer to the README for usage instructions - Added
styleIdoption totranslateText()which allows text and document translation with style rules.
v1.21.0
Added
- Added
extraRequestParametersoption to text and document translation methods to pass arbitrary parameters in the request body. This can be used to access beta features or override built-in parameters (such astarget_lang,source_lang, etc.).
v1.20.0
Added
- Official support for Node.js versions 20, 22 and 24
Fixed
- Fixed document minification/deminification to preserve translated content. Previously, when document minification was enabled, the deminify process would use the original minified file instead of the translated version, causing translations to be lost.
- Fixed handling of documents without media files during translation. The library now correctly processes documents that don't contain embedded media.