Home / Reference
Reference
Everything here is read from a record: the map of what a reader runs (map/before/<release>/map.json), the release manifests,tools/served.json. A number on these pages is not typed; a contract changes only with a release.
Pages
- The contracts: the 14 formats other sites, pages and agents program against: the meter config, a charged page, persona links, the reading-list link, article numbers, the return page, the export, the share, the envelope, the contact file, the wire's vault, events, a component, the import's rules.
- State, inputs and outputs: what
localStorageholds undersgit.meter.v1, everything that comes in and who controls it, and every channel by which anything leaves the browser. - The components: the served files by group, what each is for, how they are versioned, and which are frozen.
- The hosting model:
https://api.newsroom.sgit.ai/<release>/<path>, never edited in place; CORS; the page's origin anddata-root; pinning, the manifest and rollback; what a Content-Security-Policy must name. - The reading-list link: the grammar of
/for/#…, field by field, with the limits the parser enforces.
The element, in brief
<sg-meter view="…"> is one custom element with twelve views; the page's charge is view="page" with a kind (article_new is derived from date and newDays, the rest are article, issue, note, collection, page, free), date, topics, title, and quiet for a page that charges nothing. The config is a JSON block with id sg-meter-config; every key has a default. The views, the attributes and a full config are on the developer quick start.
Events
The meter emits DOM events on document that a page or another component can listen to: sg:meter.changed, sg:meter.charged, sg:meter.rated, sg:meter.declined, sg:meter.toppedup, sg:meter.reset, sg:meter.restored, sg:meter.persona, sg:meter.shared; and sg-meter:error when the element fails, with why.
Versions
The meter's own line is v1.4.0, served at assets/components/sg-meter/v1/v1.4/v1.4.0/; v1.0.0 to v1.3.1 are frozen and still served, so a page that pinned one keeps working. The API's releases (v0.2.5 today) wrap all of it under a versioned prefix. Releases.