Skip to content

🚀 Feature Request: Add a way to provide headers in async #2159

Closed

Description

@utkuturunc

🎤 Tell us your idea

When using the self-hosted method, it is possible to do the following:

    <CopilotKit
      runtimeUrl={`${env.NEXT_PUBLIC_API_URI}/copilotkit`}
      headers={{
        Authorization: `Bearer ${token}`,
      }}
    >

yet, if you use Clerk, getting the token itself is an async function. This is also true for localStorage operations

in component

const { getToken } = useAuth()

then to get the token

await getToken()

which is not possible to do where <CopilotKit /> is available.

Example solution

instead of headers: Record<string, string> if we have getHeaders: () => Promise<Record<string, string>>
this can be achieved.

Activity

  1. added
    feature request
    on Jul 15, 2025
  2. BenTaylorDev commented on Jul 15, 2026

    @BenTaylorDev
    Contributor

    Duplicate of #1937, which is the earlier request for the same thing (async/dynamic headers builder on the React <CopilotKit> component) and already has the discussion. Consolidating there — closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions