ChatBotKit Node SDK
CBK.AI
CBK.AI DOCS
CBK.AI MCP
ChatBotKit
GitHub Repo
GitHub Org
Preparing search index...
@chatbotkit/sdk
client
ResponsePromise
Class ResponsePromise<T, U>
Type Parameters
T
U
Index
Constructors
constructor
Methods
cache
catch
finally
get
Request
stream
then
Constructors
constructor
new
ResponsePromise
<
T
,
U
>
(
url
:
string
|
URL
,
request
:
{
data
?:
any
;
fetchFn
?:
FetchFunction
;
headers
:
Record
<
string
,
any
>
;
method
:
string
;
retries
?:
number
;
retryDelay
?:
number
;
retryTimeout
?:
boolean
;
timeout
?:
number
;
}
,
cacheMap
?:
Map
<
string
,
Promise
<
T
>
>
,
)
:
ResponsePromise
<
T
,
U
>
Type Parameters
T
U
Parameters
url
:
string
|
URL
request
:
{
data
?:
any
;
fetchFn
?:
FetchFunction
;
headers
:
Record
<
string
,
any
>
;
method
:
string
;
retries
?:
number
;
retryDelay
?:
number
;
retryTimeout
?:
boolean
;
timeout
?:
number
;
}
Optional
cacheMap
:
Map
<
string
,
Promise
<
T
>
>
= ...
Returns
ResponsePromise
<
T
,
U
>
Methods
cache
cache
(
key
?:
string
)
:
Promise
<
T
>
Parameters
Optional
key
:
string
= 'default'
Returns
Promise
<
T
>
catch
catch
<
TResult
>
(
fn
?:
(
reason
:
any
)
=>
TResult
|
PromiseLike
<
TResult
>
,
)
:
Promise
<
T
|
TResult
>
Type Parameters
TResult
Parameters
Optional
fn
:
(
reason
:
any
)
=>
TResult
|
PromiseLike
<
TResult
>
Returns
Promise
<
T
|
TResult
>
finally
finally
(
fn
?:
()
=>
void
)
:
Promise
<
T
>
Parameters
Optional
fn
:
()
=>
void
Returns
Promise
<
T
>
get
Request
getRequest
(
params
?:
{
data
?:
any
;
fetchFn
?:
FetchFunction
;
headers
?:
Record
<
string
,
any
>
;
method
?:
string
;
retries
?:
number
;
retryDelay
?:
number
;
retryTimeout
?:
boolean
;
timeout
?:
number
;
}
,
)
:
Promise
<
Response
>
Parameters
Optional
params
:
{
data
?:
any
;
fetchFn
?:
FetchFunction
;
headers
?:
Record
<
string
,
any
>
;
method
?:
string
;
retries
?:
number
;
retryDelay
?:
number
;
retryTimeout
?:
boolean
;
timeout
?:
number
;
}
Returns
Promise
<
Response
>
stream
stream
()
:
AsyncGenerator
<
U
,
any
,
any
>
Returns
AsyncGenerator
<
U
,
any
,
any
>
then
then
<
TResult1
,
TResult2
>
(
onSuccess
?:
(
value
:
T
)
=>
TResult1
|
PromiseLike
<
TResult1
>
,
onFail
?:
(
reason
:
any
)
=>
TResult2
|
PromiseLike
<
TResult2
>
,
)
:
Promise
<
TResult1
|
TResult2
>
Type Parameters
TResult1
TResult2
Parameters
Optional
onSuccess
:
(
value
:
T
)
=>
TResult1
|
PromiseLike
<
TResult1
>
Optional
onFail
:
(
reason
:
any
)
=>
TResult2
|
PromiseLike
<
TResult2
>
Returns
Promise
<
TResult1
|
TResult2
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
cache
catch
finally
get
Request
stream
then
CBK.AI
CBK.AI DOCS
CBK.AI MCP
ChatBotKit
GitHub Repo
GitHub Org
ChatBotKit Node SDK
Loading...