Skip to content

Commit 4ae206b

Browse files
committed
add an env var override for envd api url
1 parent 55c959e commit 4ae206b

File tree

1 file changed

+6
-0
lines changed
  • packages/python-sdk/e2b/sandbox

1 file changed

+6
-0
lines changed

packages/python-sdk/e2b/sandbox/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import urllib.parse
23
from packaging.version import Version
34

@@ -50,10 +51,15 @@ def __init__(
5051
self.__envd_access_token = envd_access_token
5152
self.__envd_api_url = (
5253
envd_api_url
54+
or SandboxBase._envd_api_url()
5355
or f"{'http' if self.connection_config.debug else 'https'}://{self.get_host(self.envd_port)}"
5456
)
5557
self.__mcp_token: Optional[str] = None
5658

59+
@staticmethod
60+
def _envd_api_url():
61+
return os.getenv("E2B_ENVD_API_URL")
62+
5763
@property
5864
def _envd_access_token(self) -> Optional[str]:
5965
"""Private property to access the envd token"""

0 commit comments

Comments
 (0)