Skip to content

http4s/http4s-grpc

Repository files navigation

http4s-grpc

Maven Central

A pure Scala gRPC implementation! Use it with http4s Ember or any other applicable Backend and deploy on JVM, Node.js, and Native.

The generated APIs use Cats Effect and FS2, and are nearly drop-in replacements for code generated by fs2-grpc.

Quick Start

First add the plugin to project/plugins.sbt.

addSbtPlugin("org.http4s" % "sbt-http4s-grpc" % "VERSION_FROM_BADGE")

Then in your build.sbt enable the Http4sGrpcPlugin to configure the http4s-grpc codegen. In addition, you will need to configure the ScalaPB codegen by following their installation docs.

enablePlugins(Http4sGrpcPlugin)
Compile / PB.targets ++= Seq(
  // set grpc = false because http4s-grpc generates its own code
  scalapb.gen(grpc = false) -> (Compile / sourceManaged).value / "scalapb"
)