@@ -31,15 +31,15 @@ export interface SchematicOptions {
3131 logger ?: Logger ;
3232 /** Enable offline mode to prevent network activity */
3333 offline ?: boolean ;
34- /** The default maximum time to wait for a response in seconds */
35- timeoutInSeconds ?: number ;
34+ /** The default maximum time to wait for a response in milliseconds */
35+ timeoutMs ?: number ;
3636}
3737
3838export interface CheckFlagOptions {
3939 /** Default value to return on error. Can be a boolean or a function returning a boolean. If not provided, uses configured flag defaults */
4040 defaultValue ?: boolean | ( ( ) => boolean ) ;
41- /** The maximum time to wait for a response in seconds */
42- timeoutInSeconds ?: number ;
41+ /** The maximum time to wait for a response in milliseconds */
42+ timeoutMs ?: number ;
4343}
4444
4545export class SchematicClient extends BaseClient {
@@ -60,7 +60,7 @@ export class SchematicClient extends BaseClient {
6060 eventBufferInterval,
6161 flagDefaults = { } ,
6262 logger = new ConsoleLogger ( ) ,
63- timeoutInSeconds ,
63+ timeoutMs ,
6464 } = opts ?? { } ;
6565 let { offline = false } = opts ?? { } ;
6666
@@ -88,7 +88,7 @@ export class SchematicClient extends BaseClient {
8888 apiKey,
8989 environment : basePath ,
9090 fetcher : offline ? offlineFetcher : provideFetcher ( headers ) ,
91- timeoutInSeconds,
91+ timeoutInSeconds : timeoutMs !== undefined ? timeoutMs / 1000 : undefined ,
9292 } ) ;
9393
9494 this . logger = logger ;
@@ -134,7 +134,7 @@ export class SchematicClient extends BaseClient {
134134 }
135135
136136 const response = await this . features . checkFlag ( key , evalCtx , {
137- timeoutInSeconds : options ?. timeoutInSeconds ,
137+ timeoutInSeconds : options ?. timeoutMs !== undefined ? options . timeoutMs / 1000 : undefined ,
138138 } ) ;
139139 if ( response . data . value === undefined ) {
140140 this . logger . debug ( `No value returned from feature flag API for flag ${ key } , falling back to default` ) ;
0 commit comments