publish - Methods - Events API

Events API Methods

publish()

Publish raw or valid xAPI compliant events.

You would want to use this to fire your own custom events.

Examples

eventsApp.publish({
    "xapi": false,  // whether it's a full (or raw) xAPI events array
    "events": [{
        "kind": "assess_logging",
        "actor": "learner001", // string, user_id
        "verb": "progressed", // string, verb
        "object": {  // string (unique "id") or object (full object)
            "id": "https://xapi.learnosity.com/activities/org/1/pool/null/activity/demoactivity",
            "definition": {
                "extensions": {
                    "data": 1
                }
            }
        }
    }]
});

Arguments

  • options object

    • xapi boolean

      Specifies whether the objects are XAPI-compliant.

      Default: false

    • events array[object]

      An array of event objects to publish. Every event must have a kind property.

Return value

None (undefined).

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.