[Update] October 23, 2025
Hello Creators,
We’re excited to announce that Server-Sent Events (SSE) are now supported in HTTPService within Studio! With SSE support, you can now maintain a live connection and receive streamed data from external tools and services to improve your development workflow and increase productivity.
For example, you can build a Studio plugin that no longer requires long-polling. Instead, you can now receive real-time events from an external server such as Blender, or integrate with your favorite LLM.
How to get started
- Set up HttpService as usual.
- Use the new CreateWebStreamClient() function to create an SSE client.
- Define your logic for handling streamed events (e.g., onMessage, onError).
- Connect to any endpoint that supports event streams and start processing streamed responses in real-time.
Sample Code
local HttpService = game:GetService("HttpService")
-- Be careful not to share this code with secrets inlined
local url_with_secret = ‘defineURLwithSecretHere’
-- This example calls the Google Gemini API
local function handleMessage(message)
print("Stream message received:", message)
end
local sse_client = HttpService:CreateWebStreamClient(Enum.WebStreamClientType.SSE, {
Url = url_with_secret,
Method = "POST",
Headers = {
["Content-Type"] = "application/json", },
Body = HttpService:JSONEncode({ contents = { parts = { text ="How does the SSE protocol work?" }}}),
})
local messageConnection = sse_client.MessageReceived:Connect(handleMessage)
sse_client.Closed:Wait()
messageConnection:Disconnect()
We’re excited to see how this feature helps you build more immersive games! As always, we welcome your feedback and questions. Let us know in the comments how you plan to use this in your workflows.
Roblox Creator Services Team
FAQs
Can I use this to connect to a third-party service for in-experience?
- This feature is restricted to Studio only. Any CreateWebStreamClient() requests made in a live experience will be blocked. While you can use SSE within Studio, make sure to remove any CreateWebStreamClient() calls in your code before publishing. We encourage you to create plugins with this feature for reusability and ease of use.
Can I use Secrets Stores with plugins?
- Unfortunately not at present. We are looking into how we can support the storage of secrets for plugins. We would love to hear any ideas or feedback on how you would like this to behave!
How long can streaming connections last?
- Currently, streaming connections will timeout after 30 minutes. We plan to add support for indefinite connections soon- we encourage you to add a periodic heartbeat every 20 seconds from the server.
How many streaming connections can I have active at once?
- Currently, you can have up to 4 WebStreamClients at once.