Skip to content

Commit a2be951

Browse files
committed
fixed message when apikey is not present
it correctly displays the error message if `env` is set to BROWSERBASE and apikey is undefined.
1 parent b32b2bb commit a2be951

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ async function getBrowser(
7676
browserbaseSessionCreateParams?: Browserbase.Sessions.SessionCreateParams,
7777
browserbaseSessionID?: string,
7878
localBrowserLaunchOptions?: LocalBrowserLaunchOptions,
79+
intEnv: "LOCAL" | "BROWSERBASE" = "LOCAL",
7980
): Promise<BrowserResult> {
80-
if (env === "BROWSERBASE") {
81+
if (intEnv === "BROWSERBASE") {
8182
if (!apiKey) {
8283
logger({
8384
category: "init",
@@ -677,6 +678,7 @@ export class Stagehand {
677678
this.browserbaseSessionCreateParams,
678679
this.browserbaseSessionID,
679680
this.localBrowserLaunchOptions,
681+
this.intEnv,
680682
).catch((e) => {
681683
this.stagehandLogger.error("Error in init:", { error: String(e) });
682684
const br: BrowserResult = {

0 commit comments

Comments
 (0)