An easy way to redact sensitive information from a string
const response =return io.backgroundFetch<CreateCompletionResponseData>("background","https://someapi.com/v1/endpointname",{ method:"POST", headers:{"Content-Type":"application/json",//by using `redactString` the apiKey will be redacted in the logs Authorization: redactString`Bearer ${auth.apiKey}`,}, body:JSON.stringify(params),});
redactString is a Tagged template that can be used to redact sensitive information from a string.
It is used internally to redact Bearer tokens in Integrations that use backgroundFetch.
const response =return io.backgroundFetch<CreateCompletionResponseData>("background","https://someapi.com/v1/endpointname",{ method:"POST", headers:{"Content-Type":"application/json",//by using `redactString` the apiKey will be redacted in the logs Authorization: redactString`Bearer ${auth.apiKey}`,}, body:JSON.stringify(params),});
const response =return io.backgroundFetch<CreateCompletionResponseData>("background","https://someapi.com/v1/endpointname",{ method:"POST", headers:{"Content-Type":"application/json",//by using `redactString` the apiKey will be redacted in the logs Authorization: redactString`Bearer ${auth.apiKey}`,}, body:JSON.stringify(params),});