Streaming

Streaming

Learn when you can stream back to your front end


Flowise supports streaming back to your front end application when the final node is a Chain or Tool Agent.

Setup

  1. Install socket.io-client to your front-end application

yarn add socket.io-client

Refer official docs for more installation options.

  1. Import it

import socketIOClient from 'socket.io-client'
  1. Establish connection

const socket = socketIOClient("http://localhost:3000") //flowise url
  1. Listen to connection

import { useState } from 'react'

const [socketIOClientId, setSocketIOClientId] = useState('');

socket.on('connect', () => {
  setSocketIOClientId(socket.id)
});
  1. Send query with socketIOClientId

  1. Listen to token stream

  1. Disconnect connection

PreviousEmbedNextTelemetry

Last updated 1 month ago