You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
102
84
* @param {string} [opts.baseURL=process.env['BROWSERBASE_BASE_URL'] ?? https://api.browserbase.com] - Override the default base URL for the API.
103
85
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
104
86
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
@@ -121,18 +103,11 @@ export class Browserbase extends Core.APIClient {
121
103
constoptions: ClientOptions={
122
104
apiKey,
123
105
...opts,
124
-
baseURL,
125
-
environment: opts.environment??'production',
106
+
baseURL: baseURL||`https://api.browserbase.com`,
126
107
};
127
108
128
-
if(baseURL&&opts.environment){
129
-
thrownewErrors.BrowserbaseError(
130
-
'Ambiguous URL; The `baseURL` option (or BROWSERBASE_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null',
()=>newBrowserbase({apiKey: 'My API Key',environment: 'production'}),
168
-
).toThrowErrorMatchingInlineSnapshot(
169
-
`"Ambiguous URL; The \`baseURL\` option (or BROWSERBASE_BASE_URL env var) and the \`environment\` option are given. If you want to use the environment you must pass baseURL: null"`,
170
-
);
171
-
172
-
constclient=newBrowserbase({apiKey: 'My API Key',baseURL: null,environment: 'production'});
0 commit comments