The core modules of coursier are cross-compiled and published for Scala.js. This allows to run resolutions from Node.js or from the browser, via Scala.js. Note that only the core module of coursier, running resolutions, is cross-compiled. The cache module is not, so that one cannot rely on the cache of coursier from Scala.js.
As a substitute to the cache module, a module named
fetch-js is published for Scala.js, allowing one to fetch metadata and possibly artifacts via XMLHttpRequests.
From sbt, one can depend on the core and fetch modules via
libraryDependencies ++= Seq( "io.get-coursier" %%% "coursier-core" % "2.0.7", "io.get-coursier" %%% "coursier-fetch-js" % "2.0.7" )
or simply via the
coursier module, which aggregates both,
libraryDependencies += "io.get-coursier" %%% "coursier" % "2.0.7"
As an illustration, coursier has an in-browser demo, that allows one to run resolutions entirely from the browser.