secretKey
keyword argument,
we recommend using environment variables for maximum security.
to add RACCOON_SECRET_KEY="My Secret Key"
to your .env
file
so that your Secret Key is not stored in source control.
break
from the loop
or call stream.controller.abort()
.
maxRetries
option to configure or disable this:
timeout
option:
APIConnectionTimeoutError
is thrown.
Note that requests which time out will be retried twice by default.
node-fetch
in Node, and expects a global fetch
function in other environments.
If you would prefer to use a global, web-standards-compliant fetch
function even in a Node environment,
(for example, if you are running Node with --experimental-fetch
or using NextJS which polyfills with undici
),
add the following import before your first import from "RaccoonAI"
:
import "raccoonai/shims/node"
(which does import polyfills).
This can also be useful if you are getting the wrong TypeScript types for Response
(more details).
fetch
function when instantiating the client,
which can be used to inspect or alter the Request
or Response
before/after each request:
DEBUG=true
environment variable, this library will log all requests and responses automatically.
This is intended for debugging purposes only and may change in the future without notice.
"node"
environment ("jsdom"
is not supported at this time).