-
Notifications
You must be signed in to change notification settings - Fork 668
support overriding apiUrl directly #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d8bb0cb The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
? 'http://localhost:3000' | ||
: `https://api.${this.domain}` | ||
this.apiUrl = | ||
opts?.apiUrl ?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing property that get's the value from the env var.
*/ | ||
domain?: string | ||
/** | ||
* API Url to use for the API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would add note about thie being @internal
+ @default
as debug
has.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why .tools-versions
only for the CLI?
Also the same question as in the Python PR—is apiUrl good name?
It matches the field name and the other env vars. Feels correct to me; it's the full url to the API, rather than a host or host/port, etc. |
This allows you to set E2B_API_URL and override the entire API URL in the CLI and the SDK
Note
Enable overriding the API base URL in the CLI and JS SDK via E2B_API_URL and an optional apiUrl in ConnectionConfig.
packages/js-sdk/src/connectionConfig.ts
):apiUrl
toConnectionOpts
and resolve order:opts.apiUrl
→ envE2B_API_URL
→ debughttp://localhost:3000
orhttps://api.${domain}
.E2B_API_URL
via new static getter and update docs accordingly.packages/cli/src/api.ts
):apiUrl
from envE2B_API_URL
intonew e2b.ConnectionConfig(...)
.Written by Cursor Bugbot for commit d8bb0cb. This will update automatically on new commits. Configure here.