Client Libraries

Node.js

Official Node.js Library

Example:

var herogi = require('herogi');

var herogiClient = herogi("appId", "appSecret");

//Creating an event
var event = herogiClient.createEvent("user123", "eventName",["scenario1", "scenario2"]);

//Add new parameter to event
event.addParam("param1", "value1");

//Sending event
herogiClient.sendEvent(event, function(success, response){
    console.log(success);
    console.log(response);
});

Scala

Official Scala Library

Example:

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)
}