Installation
Requirements
- Scala 3.9 (LTS) or later. uni's artifacts are compiled with Scala 3.9, and older compilers cannot read their TASTy.
- sbt 1.9+ or sbt 2.x
Adding Dependencies
Add uni to your build.sbt:
// Core utilities (object wiring, logging, JSON, HTTP, Rx, etc.)
libraryDependencies += "org.wvlet.uni" %% "uni" % "2026.1.22"HTTP Server on the JVM
To run an HTTP server on the JVM, add the Netty-based server module (it pulls in uni transitively):
// Netty-based HTTP server (JVM only)
libraryDependencies += "org.wvlet.uni" %% "uni-netty" % "2026.1.22"See the REST Server guide for usage. On Scala.js and Scala Native, the HTTP server backends (NodeServer / NativeServer) are included in uni itself — no extra module is needed.
Testing Framework
Add UniTest as a test dependency and register its test framework:
libraryDependencies += "org.wvlet.uni" %% "uni-test" % "2026.1.22" % Test
testFrameworks += new TestFramework("wvlet.uni.test.Framework")Cross-Platform Projects
For Scala.js or Scala Native projects on sbt 1.x, use %%%:
// Scala.js / Scala Native (sbt 1.x)
libraryDependencies += "org.wvlet.uni" %%% "uni" % "2026.1.22"
libraryDependencies += "org.wvlet.uni" %%% "uni-test" % "2026.1.22" % TestOn sbt 2.x, %% resolves the platform-specific artifact for all platforms, so %%% is not needed.
Scala Native and libcurl
No system libraries are needed to build a Scala Native binary against uni. Only reaching for the HTTP client pulls in libcurl, which must then be present as a shared library — see Linking libcurl on Scala Native.
Imports
Common imports for getting started:
// Object wiring
import wvlet.uni.design.Design
// Logging
import wvlet.uni.log.{LogSupport, Logger, LogLevel}
// JSON
import wvlet.uni.json.JSON
// HTTP
import wvlet.uni.http.{Http, HttpRequest, HttpResponse}
// Reactive streams
import wvlet.uni.rx.Rx
// Control flow
import wvlet.uni.control.{Retry, CircuitBreaker, Resource}Verifying Installation
Create a simple test to verify the installation:
import wvlet.uni.log.LogSupport
object Main extends App with LogSupport:
info("uni is working!")Run with:
sbt runYou should see log output with your message.
IDE Support
uni works with all major Scala IDEs:
- IntelliJ IDEA with Scala plugin
- VS Code with Metals
- Neovim with Metals
The library uses standard Scala 3 features, so IDE support is seamless.
