Skip to content

Conversation

djeebus
Copy link
Contributor

@djeebus djeebus commented Oct 13, 2025

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.

  • SDK (packages/js-sdk/src/connectionConfig.ts):
    • Add apiUrl to ConnectionOpts and resolve order: opts.apiUrl → env E2B_API_URL → debug http://localhost:3000 or https://api.${domain}.
    • Read E2B_API_URL via new static getter and update docs accordingly.
  • CLI (packages/cli/src/api.ts):
    • Pass apiUrl from env E2B_API_URL into new e2b.ConnectionConfig(...).

Written by Cursor Bugbot for commit d8bb0cb. This will update automatically on new commits. Configure here.

Copy link

changeset-bot bot commented Oct 13, 2025

🦋 Changeset detected

Latest commit: d8bb0cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
e2b Patch
@e2b/cli Patch

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

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

? 'http://localhost:3000'
: `https://api.${this.domain}`
this.apiUrl =
opts?.apiUrl ??
Copy link
Member

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.
Copy link
Member

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.

Copy link
Member

@ValentaTomas ValentaTomas left a 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?

@ValentaTomas ValentaTomas changed the title support overriding api_url directly support overriding apiUrl directly Oct 14, 2025
@ValentaTomas ValentaTomas self-assigned this Oct 14, 2025
@djeebus
Copy link
Contributor Author

djeebus commented Oct 14, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants