mozilla / shield-studies-addon-utils

Mozilla Public License 2.0
7 stars 21 forks source link
WebExtensions API:s Engineering your add-on

Shield Studies Add-on Utils

CircleCI badge

Features

This is the home of the shield-studies-addon-utils npm package, which provides:

shield-study telemetry

Validate and send shield-study, shield-study-addon Telemetry, allowing experiments to submit experiment-scoped stringified key-value pairs that are directly available for analysis.

Pioneer telemetry

Validate, encrypt and send shield-study, shield-study-addon Pioneer Telemetry.

Other telemetry helpers

Validate telemetry payloads against JSON schemas and calculate the size of a ping before submitting it.

Add-on test helpers

Helper classes and methods to write Selenium-based functional/unit tests for your study add-on.

Survey URLs helper

For formatting 'post' and 'mid-study' survey URLs to have correct appended query arguments in the format that matches the corresponding SurveyGizmo library elements

Help and support

Thinking about building a Study Add-on? Please read the docs on Pref-Flip and Add-On Experiments first.

Installing Shield Studies Add-on Utils in your add-on

npm install --save shield-studies-addon-utils
  "experiment_apis": {
    "study": {
      "schema": "./privileged/study/schema.json",
      "parent": {
        "scopes": ["addon_parent"],
        "script": "./privileged/study/api.js",
        "paths": [["study"]]
      }
    }
  },

WebExtension APIs Provided by Shield Studies Add-on Utils

browser.study.*

browser.study API documentation

Supported telemetry pipelines

Depending on which telemetry pipeline is used, the pings end up in different destinations:

browser.studyDebug.*

browser.studyDebug API documentation

Used by the project-internal tests only.

Engineering your own study add-on

Development on the Shield-Studies-Addon-Utils

History of recent major versions

* Some features that was handled in v5 has not been ported over to neither Normandy nor v6 of the utils: