Embed streamlit app

We need to embed an existing Streamlit app (site A) to another website (site B) in order to get the company’s header, footer, traffic analysis, and so on. iframe is not allowed to use.

We tried to prepare a js script for site B

  • obtain HTML (site A) via a DOMParser XMLHttpRequest
  • query select css and js links and append to the HTML (site B)
  • query select app root and append to the HTML (site B)

but it gives some error as below. In Streamlit js, it failed as the endpoint has been changed.

main.d83a2e9b.chunk.js:1 WebSocket connection to 'ws://localhost:8000/stream' failed: Error during WebSocket handshake: Unexpected response code: 404
10.3ed0fb7a.chunk.js:1 GET http://localhost:8000/healthz 404 (File not found) 

My question is

  • am I in a right direction to embed the Streamlit app?
  • is there any other more straightforward methods?

Thanks

Hi @kwunlyou, welcome to the Streamlit community!

If you’re not allowed to use iframes, then I’m not sure this is possible. How would your embed communicate with the Streamlit backend, without itself being a Streamlit app?