Novelty Plastic Moustache


    1.4.1 • Public • Published

    Hermes JS Library


    Hermes library performs the following tasks:

    • Queue service
    • Event messaging

    Queue Service

    This service handles the device storage, when there's a new message, it will always be saved in the storage. If storage is unavailable, it will mantain a cache queue that will get deleted on page leave.

    Event Messaging

    This service needs to be initialized with the hermes url, and then will send events that are in the queue whenever the connection is available


    Simply require the javascript file into your project!

    <script type="text/javascript" src="js/hermes-js.js"></script>


    The first step is to create the Hermes object, with the following initial configuration:

    • (string) Url: Hermes URL (should be
    • (json) Project: A project object is composed of the project ID (e.g: 'nike_run_analysis') and the project readable name (e.g: 'Nike Run Analysis NBA')
    • (string) Type: The type of events that will be sent, will probably be either appData or deviceStatus type

    Configuration example

    // Este es el use case tipico
    	var hermes = new Hermes({
    		url: '',
    		project: {
    			"id": 'nike_run_analysis',
    			"name": 'Nike Run Analysis'
    		type: 'appData'

    After setting up the object, all that remains is to send messages, and there is a simple way to do so:


    The send event will send the data to hermes, if internet is not connected, it will be saved in the cache to be sent when internet is available.

    Data sent can be anything! But Hermes expects it to be a JSON object. A warning will be sent if it isn't.

    Full example

    <script type="text/javascript" src="hermes-js.js"></script>
    <script type="text/javascript">
    	var config = {
    		url: '',
    		project: {
    			"id": 'nike_run_analysis',
    			"name": 'Nike Run Analysis'
    		type: 'appData'
    	var hermes = new Hermes(config)
    	var event = {
    		name: 'new_experience',
    		experience_id: 2


    • Code needs some refactoring, as of now, all work lies within the Hermes Class, and probably needs to shift some responsabilities to the HermesEvent class


    npm i @p4d/hermes-js

    DownloadsWeekly Downloads






    Last publish


    • javougarte
    • shipupi
    • tmigone
    • p4d-owner