Repository navigation
README: pass a bare host name to ConvertApi.auth - #34
Merged
Merged
Conversation
The "Alternative domain" example passed 'https://eu-v2.convertapi.com/'. The library builds request URLs as https://${host}/convert/... and https://${host}/upload?..., so that value produced https://https://eu-v2.convertapi.com//convert/..., which looks up a host named "https" and fails with "fetch failed" (ENOTFOUND). The example has been wrong since it was added on 2023-07-04. Use 'eu-v2.convertapi.com', say that the argument is a host name without https:// or a trailing slash, and name the default host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for this README-only change clarifying the regional host argument format.
No open issues 🎉
What changed in this PR
Corrects the README’s regional-server example to match the host-name format expected by ConvertApi.auth. No library code changes.
Changes:
- Removes
https://and the trailing slash from the example host. - Clarifies the second argument’s format, documents the default host, and retains the link to regional server locations.
| File | Description |
|---|---|
| README.md | Fixes the regional-host example and clarifies host argument requirements. |
Review effort: Balanced
tomasr78
added a commit
that referenced
this pull request
Nov 12, 2026
Brings in #34, which changes README.md only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The "Alternative domain" example in README.md passed a URL as the host:
The library expects a bare host name. It builds request URLs as
https://${this.host}/convert/...(src/convertapi.ts)and
https://${this.host}/upload?...(src/file-param.ts). With the README's value, every request went tohttps://https://eu-v2.convertapi.com//convert/.... The URL parser readshttpsas the host, so the request failswith
TypeError: fetch failed(ENOTFOUND). The example has been wrong since it was added on 2023-07-04 in93fa8fe; the library
already prefixed
https://then.This PR changes the example to
and rewrites the sentence above it. The sentence now says that the second argument is a host name without
https://or a trailing slash, that the default is
v2.convertapi.com, and where the regional hosts are listed. The change isin README.md only; the code is unchanged.
Checks
v2,uk-v2,eu-v2,us-v2,ca-v2,as-v2,jp-v2andau-v2(all.convertapi.com). On 2026-11-12 all eight resolved and answered the API(401 without credentials). The README names only
v2.convertapi.comandeu-v2.convertapi.com.node --test test/live.test.jswith a staging token andCONVERT_API_HOST=stag-v2.convertapi.com, a bare host:3 of 3 pass.
fetch failed (ENOTFOUND https), before any request reaches ConvertAPI.test/convertapi.test.jsalready passes a bare host ('example.test').of README.md (checked with
git merge-tree). Either PR can merge first.The same mistake on convertapi.com
needs its own fix on the site; this PR does not change it.
pages are fine: their template calls
ConvertApi.auth('{{secret}}')with no host. The pages underhttps://www.convertapi.com/docs have no JavaScript SDK code.
🤖 Generated with Claude Code