Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 870 Bytes

File metadata and controls

28 lines (23 loc) · 870 Bytes
title redactString
description An easy way to redact sensitive information from a string

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),
  }
);