Add a new library dependency to a Scala Golem project. Use when the user asks to add a library, package, or dependency.
%%% operator (triple percent) in build.sbt so sbt resolves the _sjs1_ cross-published variant.java.io.File, java.net.Socket, threads, etc.) will not work.golem build to find out.Add the dependency to build.sbt
In the component's build.sbt, add the library under libraryDependencies:
libraryDependencies += "com.example" %%% "library-name" % "1.0.0"
Use %%% (not %%) to get the Scala.js variant of the library.
Build to verify
golem build
Do NOT run sbt compile directly — always use golem build.
If the build fails
_sjs1_ in the Maven/Sonatype listing.These are already in the project's build.sbt — do NOT add them again:
golem-scala-sdk — Golem agent framework, durability, transactionsscala-js-dom — DOM API bindings (if present)Use the Golem SDK's HTTP client utilities. Standard JVM networking (java.net) is not available in Scala.js/WASM.