SEE Server Sent events
Is there any examples of SEE server sent event providers
9 Replies
Hi @Joe Gaffney. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, there are examples of using Server-Sent Events (SSE) with HTMX in the provided knowledge sources. Here is an example of how to use SSE with HTMX:
To send events to browsers using SSE, you need to add a
connect <url>
declaration to a parent element and use the hx-sse
attribute with the URL. You will also use the hx-trigger="sse:<event_name>"
attribute to define elements that are activated by server-sent events.
Here is a sample code snippet:
In this example:
- The hx-sse="connect:/darth-events"
attribute on the <body>
element establishes a connection to the SSE endpoint /darth-events
.
- The hx-trigger="sse:new_news"
attribute on the <div>
element specifies that this element should be triggered by the new_news
event sent from the server.
- The hx-get="/news"
attribute specifies that when the new_news
event is received, an HTTP GET request should be made to the /news
endpoint.
For more detailed information, you can refer to the HTMX documentation on Web Sockets & SSE (https://refine.dev/blog/what-is-htmx/#web-sockets--sse).
If you need further examples or detailed documentation, you might want to explore the Refine documentation (https://refine.dev/docs/examples/audit-log/audit-log-provider/) or the source code on GitHub (https://github.com/refinedev/refine/tree/master/examples/audit-log-provider).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@422289470487003153> kapa.ai is still learning and improving, please let us know how it did by reacting below
extended-salmon•2mo ago
@kapa.ai no im looking for refine examples
Let me check the knowledge base for you. One moment! :books:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, you can explore the Refine documentation (https://refine.dev/docs/) for more information or check out the examples section (https://refine.dev/examples/) to see if there are any relevant examples that might help you.
If you have any other questions or need further assistance, feel free to ask!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@422289470487003153> kapa.ai is still learning and improving, please let us know how it did by reacting below
extended-salmon•2mo ago
@kapa.ai is there like a liver provider examples that can do this
Let me check the knowledge base for you. One moment! :books:
----------------------
Yes, Refine does support live providers, which enable real-time updates to your application. For example, when a user creates a new record, other users can see the new record in the list page without refreshing the page.
However, based on the provided knowledge sources, there are no specific examples of using Server-Sent Events (SSE) with a live provider in Refine. There are requests and discussions about implementing live providers with GraphQL subscriptions and Hasura, but no concrete examples are provided.
Here are some relevant points from the knowledge sources:
1. Live Provider Concept:
- The live provider enables real-time updates to your application. For example, when a user creates a new record, other users can see the new record in the list page without refreshing the page.
- Source (https://refine.dev/docs/guides-concepts/general-concepts/#provider-concept)
2. Requests for Examples:
- There are requests for examples of using Refine with Hasura LiveProvider and GraphQL subscriptions for live data updates.
- GitHub Issue 2091 (https://github.com/refinedev/refine/issues/2091)
- GitHub Issue 4178 (https://github.com/refinedev/refine/issues/4178)
Given this information, it seems that while the concept of live providers is supported, specific examples for SSE or similar implementations are not readily available in the provided sources.
For more detailed information or to request specific examples, you might want to explore the Refine documentation (https://refine.dev/docs/) or raise a query in the Refine GitHub discussions (https://github.com/refinedev/refine/discussions).
If you have any other questions or need further assistance, feel free to ask!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@422289470487003153> kapa.ai is still learning and improving, please let us know how it did by reacting below
like-gold•2mo ago
Hey @Joe Gaffney we don't have any feature with SSE, but could be useful.