Forest Admin - API reference
    Preparing search index...

    Function injectOauthToken

    • Injects the OAuth token as Authorization header into HTTP-based transport configurations. For stdio transports, returns the config unchanged.

      Parameters

      • __namedParameters: {
            serverConfig:
                | {
                    args: string[];
                    command: string;
                    cwd?: string;
                    encoding?: string;
                    env?: Record<string, string>;
                    restart?: { delayMs?: number; enabled?: boolean; maxAttempts?: number };
                    stderr?: "pipe" | "ignore" | "inherit" | "overlapped";
                    transport?: "stdio";
                    type?: "stdio";
                } & {
                    defaultToolTimeout?: number;
                    outputHandling?: | "content"
                    | "artifact"
                    | {
                        audio?: "content"
                        | "artifact";
                        image?: "content" | "artifact";
                        resource?: "content" | "artifact";
                        resource_link?: "content" | "artifact";
                        text?: "content" | "artifact";
                    };
                }
                | {
                    authProvider?: OAuthClientProvider;
                    automaticSSEFallback?: boolean;
                    headers?: Record<string, string>;
                    reconnect?: { delayMs?: number; enabled?: boolean; maxAttempts?: number };
                    transport?: "http" | "sse";
                    type?: "http" | "sse";
                    url: string;
                } & {
                    defaultToolTimeout?: number;
                    outputHandling?: | "content"
                    | "artifact"
                    | {
                        audio?: "content"
                        | "artifact";
                        image?: "content" | "artifact";
                        resource?: "content" | "artifact";
                        resource_link?: "content" | "artifact";
                        text?: "content" | "artifact";
                    };
                };
            token?: string;
        }

      Returns
          | {
              args: string[];
              command: string;
              cwd?: string;
              encoding?: string;
              env?: Record<string, string>;
              restart?: { delayMs?: number; enabled?: boolean; maxAttempts?: number };
              stderr?: "pipe" | "ignore" | "inherit" | "overlapped";
              transport?: "stdio";
              type?: "stdio";
          } & {
              defaultToolTimeout?: number;
              outputHandling?: | "content"
              | "artifact"
              | {
                  audio?: "content"
                  | "artifact";
                  image?: "content" | "artifact";
                  resource?: "content" | "artifact";
                  resource_link?: "content" | "artifact";
                  text?: "content" | "artifact";
              };
          }
          | {
              authProvider?: OAuthClientProvider;
              automaticSSEFallback?: boolean;
              headers?: Record<string, string>;
              reconnect?: { delayMs?: number; enabled?: boolean; maxAttempts?: number };
              transport?: "http" | "sse";
              type?: "http" | "sse";
              url: string;
          } & {
              defaultToolTimeout?: number;
              outputHandling?: | "content"
              | "artifact"
              | {
                  audio?: "content"
                  | "artifact";
                  image?: "content" | "artifact";
                  resource?: "content" | "artifact";
                  resource_link?: "content" | "artifact";
                  text?: "content" | "artifact";
              };
          }