@@ -7,12 +7,16 @@ import {
7
7
} from 'browser-use-sdk/lib/webhooks' ;
8
8
import { createServer , IncomingMessage , type Server , type ServerResponse } from 'http' ;
9
9
10
+ import { env } from './utils' ;
11
+
12
+ env ( ) ;
13
+
10
14
const PORT = 3000 ;
11
- const WAIT_FOR_TASK_FINISH_TIMEOUT = 30_000 ;
15
+ const WAIT_FOR_TASK_FINISH_TIMEOUT = 60_000 ;
12
16
13
17
// Environment ---------------------------------------------------------------
14
18
15
- const WEBHOOK_SECRET = process . env [ 'WEBHOOK_SECRET ' ] ;
19
+ const SECRET_KEY = process . env [ 'SECRET_KEY ' ] ;
16
20
17
21
// API -----------------------------------------------------------------------
18
22
@@ -24,8 +28,8 @@ const browseruse = new BrowserUse();
24
28
const whServerRef : { current : Server | null } = { current : null } ;
25
29
26
30
async 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' ) ;
29
33
process . exit ( 1 ) ;
30
34
}
31
35
@@ -58,7 +62,7 @@ async function main() {
58
62
timestamp,
59
63
} ,
60
64
{
61
- secret : WEBHOOK_SECRET ,
65
+ secret : SECRET_KEY ,
62
66
} ,
63
67
) ;
64
68
@@ -67,7 +71,7 @@ async function main() {
67
71
console . log ( body ) ;
68
72
console . log ( signature , 'signature' ) ;
69
73
console . log ( timestamp , 'timestamp' ) ;
70
- console . log ( WEBHOOK_SECRET , 'WEBHOOK_SECRET ' ) ;
74
+ console . log ( SECRET_KEY , 'SECRET_KEY ' ) ;
71
75
72
76
res . writeHead ( 401 , { 'Content-Type' : 'application/json' } ) ;
73
77
res . end ( JSON . stringify ( { error : 'Invalid signature' } ) ) ;
0 commit comments