Skip to content

Conversation

@ShuffleReady
Copy link

I was able to modify headers in all but the streaming case. This modifies the onRequest hook to be called before fetchEventSource as well.

Requested here as well: #302 (comment)

ShuffleReady and others added 2 commits July 7, 2025 13:59
Missing comma in config example
…omponents that send requests.

- Update components that now have good type safety to include onRequest in calls to server / prop passing. (BotBubble & LeadCapture for example)
@phasmax
Copy link

phasmax commented Jul 29, 2025

Any ETA on this being merged?

@kientv
Copy link

kientv commented Sep 24, 2025

@ShuffleReady I already tried, but seem that your PR is not working with streaming request

@ShuffleReady
Copy link
Author

How did you try using it?

I'm using it with streaming like so:

const chatBotConfig = {
  chatflowid,
  apiHost,
  onRequest: async (request) => {
    // This gets called for all requests including streaming ones
    request.credentials = 'include';
  },
  ...

I made the changes because changing the request headers or credentials only worked with non-streaming requests.

@kientv
Copy link

kientv commented Sep 25, 2025

How did you try using it?

I'm using it with streaming like so:

const chatBotConfig = {
  chatflowid,
  apiHost,
  onRequest: async (request) => {
    // This gets called for all requests including streaming ones
    request.credentials = 'include';
  },
  ...

I made the changes because changing the request headers or credentials only worked with non-streaming requests.
@ShuffleReady
Yes, but it's not trigger onRequest hook in streaming query
and your solution is not same as @Casper Jensen, what's include?

Do you support fetchResponseFromEventStream?

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

Labels

None yet

4 participants