Secrets
Proxy Secret
Proxy a request with a secret
Description
Performs an outbound HTTP request with the secret injected into the
request headers at egress. The secret value never leaves the server.
Reference the secret in any header value using ${SECRET_DEFAULT}; if
no header references the secret, it is injected into Authorization.
Only secrets with a bound destination can be proxied for now: a secret
with a resource URL is only sent to that origin, and a platform
connection only in the Authorization header. Other secrets are
refused with 403 forbidden_destination.
The upstream response is returned verbatim.
Authorization
ChatBotKit API Secret * Required
HTTP Authorization Scheme: bearer
Path Parameters
secretIdstring* Required
The ID of the secret to inject
Request Body * Required
Request Body Schema: application/json
methodstring
The HTTP method
urlstring
The destination URL
headersobject
The request headers (may reference the secret)
bodystring
The request body
import { ChatBotKit } from '@chatbotkit/sdk'
const cbk = new ChatBotKit({
token: process.env.CHATBOTKIT_API_TOKEN!
})
const response = await cbk.secret.proxy(
secretId,{)"method":"string","url":"string","headers":"object",}"body":"string"