herogi / herogi-scala   2.0.0

Website GitHub

Herogi scala helper library

Scala versions: 2.11

herogi-scala

Herogi scala helper library

SBT Settings

Just add herogi as a dependency.

Latest:

"com.herogi.client" %% "herogi-client" % "1.0.0-SNAPSHOT"

Your First Event

Following is minimum needed code send an event to Herogi, you can find the full example here.

  implicit val system = ActorSystem()
  implicit val ec = scala.concurrent.ExecutionContext.Implicits.global

  val eventSender = new HerogiEventSender("appid", "appsecret")

  val event = new Event("s1", "e1", List("scenario1"), Some(Map("param1" -> "value1")))

  eventSender.sendEvent(event) map { res =>
    println(res)
  }

Sending to All Scenarios

To send all scenarios available, you can skip to scenario specifying during event creation:

val event = new Event("s1", "e1", List.empty, Some(Map("param1" -> "value1")))

//or better

val event = new Event(sessionId = "s1", eventName = "e1", params = Some(Map("param1" -> "value1")))