MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / getBearerToken

Function getBearerToken

app/client/api.ts:231–238  ·  view source on GitHub ↗
(
  apiKey: string,
  noBearer: boolean = false,
)

Source from the content-addressed store, hash-verified

229}
230
231export function getBearerToken(
232 apiKey: string,
233 noBearer: boolean = false,
234): string {
235 return validString(apiKey)
236 ? `${noBearer ? "" : "Bearer "}${apiKey.trim()}`
237 : "";
238}
239
240export function validString(x: string): boolean {
241 return x?.length > 0;

Callers 2

stabilityRequestCallFunction · 0.90
getHeadersFunction · 0.85

Calls 1

validStringFunction · 0.85

Tested by

no test coverage detected