@@ -7,12 +7,16 @@ import {
77} from 'browser-use-sdk/lib/webhooks' ;
88import { createServer , IncomingMessage , type Server , type ServerResponse } from 'http' ;
99
10+ import { env } from './utils' ;
11+
12+ env ( ) ;
13+
1014const PORT = 3000 ;
11- const WAIT_FOR_TASK_FINISH_TIMEOUT = 30_000 ;
15+ const WAIT_FOR_TASK_FINISH_TIMEOUT = 60_000 ;
1216
1317// Environment ---------------------------------------------------------------
1418
15- const WEBHOOK_SECRET = process . env [ 'WEBHOOK_SECRET ' ] ;
19+ const SECRET_KEY = process . env [ 'SECRET_KEY ' ] ;
1620
1721// API -----------------------------------------------------------------------
1822
@@ -24,8 +28,8 @@ const browseruse = new BrowserUse();
2428const whServerRef : { current : Server | null } = { current : null } ;
2529
2630async function main ( ) {
27- if ( ! WEBHOOK_SECRET ) {
28- console . error ( 'WEBHOOK_SECRET is not set' ) ;
31+ if ( ! SECRET_KEY ) {
32+ console . error ( 'SECRET_KEY is not set' ) ;
2933 process . exit ( 1 ) ;
3034 }
3135
@@ -58,7 +62,7 @@ async function main() {
5862 timestamp,
5963 } ,
6064 {
61- secret : WEBHOOK_SECRET ,
65+ secret : SECRET_KEY ,
6266 } ,
6367 ) ;
6468
@@ -67,7 +71,7 @@ async function main() {
6771 console . log ( body ) ;
6872 console . log ( signature , 'signature' ) ;
6973 console . log ( timestamp , 'timestamp' ) ;
70- console . log ( WEBHOOK_SECRET , 'WEBHOOK_SECRET ' ) ;
74+ console . log ( SECRET_KEY , 'SECRET_KEY ' ) ;
7175
7276 res . writeHead ( 401 , { 'Content-Type' : 'application/json' } ) ;
7377 res . end ( JSON . stringify ( { error : 'Invalid signature' } ) ) ;
0 commit comments