Library / SDK
taoensso/sente avatar
taoensso/sente

Sente Realtime WebSockets and Ajax Fallback for Clojure

Realtime web comms library for Clojure/Script

1,795 stars194 forksClojureNOASSERTION

At a glance

What is it?
Sente is a Clojure and ClojureScript client-server library for bidirectional browser communication. It unifies WebSockets and Ajax behind one API, with reconnects, batching, acknowledgements, and transport fallback.
Who is it for?
Sente fits Clojure or ClojureScript applications that need one event-oriented API across WebSockets and Ajax, especially when fallback behavior and ordinary Clojure values are requirements. It is less suitable when a non-Clojure stack, a fixed stable release policy, or a documented one-command installation path is mandatory.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 63 days ago.
What is it written in?
Mainly Clojure, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 22, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Sente's Unified Transport for Browser Events

Sente addresses a specific browser communication problem: an application often wants persistent, bidirectional messaging, but cannot assume that every request will succeed over WebSockets. It is intended for developers building realtime web applications with Clojure on the server and ClojureScript in the browser. The library provides a shared client and server model rather than requiring application code to manage each transport separately.

The README identifies WebSockets, Ajax, and core.async as the underlying mechanisms. Its capability table shows why those transports are not interchangeable. WebSockets provide native client-to-server sending, native server-to-user push, and emulated acknowledgements and replies. Ajax provides emulated client-to-server sending and server-to-user push, but native acknowledgement and reply support. Sente places these differences behind a unified API, so the application can send events and handle responses without selecting a transport for every operation.

This is useful for applications with ordinary chat-style event flow as well as request-style interactions that need confirmation from the server. The limitation is equally clear: Sente does not make WebSockets mandatory at the network level. Its fallback behavior creates a compatibility advantage, but it also means application developers must reason about a protocol lifecycle rather than debugging a single persistent socket in isolation.

Connection Lifecycle, Batching, and Event Routing

The documented connection lifecycle includes keep-alive handling, buffering, protocol selection, and reconnects. Those features matter because browser connectivity can change while a page remains open. Sente is designed to preserve the application's event-oriented view of communication while the library manages lower-level transport concerns.

Automatic event batching is another project-specific design choice. The README says it reduces bandwidth use and works even when communication falls back to Ajax. This makes batching more than a WebSocket optimization. An application can send a group of events through Ajax without giving up batching, although the README does not document batch-size controls, flush timing, or ordering guarantees.

The library also supports users connected through multiple clients or devices and can report which users are connected and which protocols they use. Based on those documented capabilities, Sente models more than a one-to-one socket pair. Its API is intended to address a user identity across several connections and route events to that user.

The README does not document retry limits, duplicate-event handling, delivery guarantees after disconnection, or the precise buffering boundary. Those omissions matter in applications where every action must be exactly once. They also prevent a firm claim that reconnects alone provide durable messaging. Sente automates connection recovery, but durable business-level processing requires separate application logic.

Clojure Values, Packers, and Server Integration

Sente can send arbitrary Clojure values and, according to the README, uses high-speed binary serialization from v1.21 onward. The repository topics list Transit and EDN, while the documentation also points to a packer interface for extending the transmission format. This gives a Clojure-oriented project more freedom in message content than a transport tied to one browser-safe object shape.

Serialization is still a compatibility boundary. The README does not enumerate which values are safe across every supported server and browser combination, nor does it document how custom Clojure records behave after a format change. Packers are replaceable through the documented `IPacker2` interface, but choosing an alternative would require checking its API documentation rather than assuming that every packer supports identical value types.

On the server side, Sente follows the Ring security model and says that authentication, HTTPS, and CSRF support remain the application's concern. That is a useful division of responsibility, but not a turnkey security configuration. The server adapter is selected through `IServerChanAdapter`, and the repository links to diverse supported web servers. The README does not identify a default adapter or provide its configuration, so server selection must be confirmed in the getting-started documentation.

For engineers, the practical distinction is between transport abstraction and application integration. Sente can unify network behavior and value serialization, but the surrounding Ring server, authentication rules, CSRF policy, and chosen packer still form part of the production design.

Getting Started Through the Sente Wiki

The README does not include dependency coordinates, an installation command, a server configuration example, or a complete first-event program. It directs new users to the GitHub wiki's getting-started page and the cljdoc API reference. The repository contains `project.clj` and an `example-project/`, but the README does not show their contents, so reproducing a dependency declaration here would risk inventing instructions.

A first real use therefore begins in the documented getting-started material. The reader should verify which Sente version that guide targets, add the dependencies named there to the relevant Clojure or ClojureScript project, configure the server adapter, and establish the browser client connection. The project homepage at `https://www.taoensso.com/sente` and the GitHub wiki are the documented sources for that route.

Version selection needs special care. The README names v1.23.0-RC1 as the latest release, dated 2026-08-21. It also lists v1.23.0-beta1 and the stable v1.22.0 release. No installation snippet is published for any of them. A project that does not require the newest API should at least compare the v1.22.0 and v1.23.0-RC1 documentation before choosing coordinates, because a release candidate and a stable release carry different upgrade expectations even when their code is from the same minor release line.

Sente's Trade-offs Against Direct Sockets and Socket.IO

The closest named comparison in the README is Socket.IO, which inspired Sente. The README names Socket.IO as an inspiration but does not compare the two libraries' implementation details. For a Clojure codebase, Sente's integration model is more relevant than treating Socket.IO as a drop-in equivalent.

Compared with writing directly against a web server's WebSocket channel, Sente moves connection concerns into a shared library. The documented keep-alive, buffering, protocol selection, reconnects, batching, and Ajax fallback remove several pieces of per-application plumbing. It also introduces another abstraction layer. Developers must debug the adapter, packer, event routing, and transport fallback behavior when diagnosing communication.

Compared with ordinary Ajax polling, Sente's native WebSocket path supports server-to-user push and avoids requiring application code to schedule every poll. Its Ajax fallback retains event and reply behavior when WebSockets are unavailable, but the README does not say exactly how fallback is triggered or how an application observes a transport change. It does confirm that connected-user protocol information is available.

The wrong choice is a non-Clojure application that cannot take on Sente's runtime and data-model assumptions. It is also a poor fit for a simple request-response service that does not need persistent connections, batching, or browser event routing.

Maintenance Signals and EPL 1.0 Responsibilities

The repository is not archived, and its last push was on 2026-08-21. That is recent activity, while it does not establish compatibility for every release candidate. The release sequence provides a more concrete upgrade signal: v1.22.0 appeared on 2026-07-02, v1.23.0-beta1 on 2026-08-06, and v1.23.0-RC1 on 2026-08-21. A production adoption decision may therefore involve choosing between the current stable line and a candidate line that was still changing.

Upgrade cost is likely to depend on the integration points Sente exposes rather than on application event handlers alone. Server adapters, packers, authentication, CSRF configuration, and custom serialized values are the areas where a transport or serialization change can have effects beyond ordinary business logic. The repository includes `CHANGELOG.md` and `SECURITY.md`, but the README does not describe their contents, so no release-specific migration steps or security policy claims can be confirmed from it.

The README states that the project is licensed under EPL 1.0, the same license as Clojure. The repository metadata labels the license as custom and cannot classify it, which makes direct inspection of `LICENSE.txt` necessary before distribution or modification. EPL 1.0 is file-level copyleft with specified exception mechanisms, so organizations should review that file and any dependency licenses with their own legal process. This is license identification, not legal advice.

Editorial conclusion

Sente fits Clojure or ClojureScript applications that need one event-oriented API across WebSockets and Ajax, especially when fallback behavior and ordinary Clojure values are requirements. It is less suitable when a non-Clojure stack, a fixed stable release policy, or a documented one-command installation path is mandatory. Before adoption, inspect the current getting-started documentation, the selected web server adapter and packer, and the exact contents of LICENSE.txt, particularly when evaluating v1.23.0-RC1.

Frequently asked questions

How do I install Sente in a Clojure or ClojureScript project?

The README does not publish dependency coordinates or an installation command. It directs users to the GitHub wiki's getting-started guide, the project homepage, and the cljdoc API reference.

What happens when WebSockets are unavailable in Sente?

The README says Sente selects a protocol automatically and supports Ajax fallback. It does not document the detection rules, fallback limits, or retry policy.

Which Sente version should a production project use?

The README names v1.23.0-RC1 as the latest release and also lists v1.22.0 as a stable release. It does not provide a production adoption policy, so the release notes and getting-started documentation should be compared before selection.

Does Sente guarantee message delivery after a disconnect?

Sente documents buffering and reconnects, but the README does not state delivery guarantees, duplicate handling, or buffering limits. Applications requiring stronger guarantees cannot infer them from those features alone.

Can Sente communicate using multiple web servers?

The README links to the `IServerChanAdapter` interface and says that diverse web servers are supported. It does not name a default server or provide adapter configuration.

Official sources

  1. Issues
  2. Project website
  3. README
  4. Releases
  5. taoensso/sente on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/taoensso-sente.svg)](https://hysenlabs.com/projects/taoensso-sente)

Was this useful?