Service reference
Every service that the logic of a PlayerVox OverCrow widget can call, with what it requires, when it can be called, its parameters and its result. Services and permissions explains how calls, subscriptions, errors and user actions work; this page is the list.
if (canRead) {
state.stopwatch = next;
}
},
() => {},
);
}In the SDK, a service stopwatch.subscribe is the function
stopwatch.subscribe of the stopwatch namespace. A call returns a
promise of its result; a subscription takes a listener that receives each
update.
How to read a service
- Kind: a call is answered once; a subscription delivers a value at once, then each new value.
- Requires: the permission or the capability to declare in the manifest, which the user must grant.
- When it can be called: at any time, or only during a user action.
- Parameters: the members of the object to pass; a
?marks an optional one. A type such as "text ≤ 128 bytes" gives a limit. - Result, or Each update for a subscription: what the service answers, and the error codes that are specific to it. Every service can also fail with the general error codes.
- Shape: the type of the result, described in result shapes.
Services
storage.get
- Kind: call, answered once
- Requires: permission
storage - When it can be called: At any time
- Parameters:
key: text ≤ 128 bytes - Result: stored JSON value or
null - Shape: JSON
storage.set
- Kind: call, answered once
- Requires: permission
storage - When it can be called: At any time
- Parameters:
key: text ≤ 128 bytes;value: JSON - Result:
null;quota_exceededbeyond 256 KiB - Shape:
null
storage.remove
- Kind: call, answered once
- Requires: permission
storage - When it can be called: At any time
- Parameters:
key: text ≤ 128 bytes - Result:
null
storage.keys
- Kind: call, answered once
- Requires: permission
storage - When it can be called: At any time
- Parameters: none
- Result: list of keys
- Shape: list of text
http.fetch
- Kind: call, answered once
- Requires: permission
network - When it can be called: At any time
- Parameters:
url: text ≤ 2 KiB;method:GET|POST|PUT|PATCH|DELETE;contentType?:application/json|text/plain;as:json|text|bytes|image - Result:
{ status, contentType }with the body, ≤ the rule'smaxResponseBytes(1 MiB when absent), or{ status, asset }from a body ≤ 1 MiB - Shape:
HttpResponse
clipboard.writeText
- Kind: call, answered once
- Requires: permission
clipboardWrite - When it can be called: Only during a user action
- Parameters:
text: text ≤ 16 KiB - Result:
null
gameEvents.subscribe
- Kind: subscription
- Requires: permission
gameEvents - When it can be called: At any time
- Parameters: none
- Each update:
{ event, at }for each declared event - Shape:
GameEvent
session.subscribe
- Kind: subscription
- Requires: capability
session.read - When it can be called: At any time
- Parameters: none
- Each update:
{ elapsedMs, at }counted from the start of the game process, ornullwithout an active game - Shape:
Sessionornull
telemetry.subscribe
- Kind: subscription
- Requires: capability
telemetry.read - When it can be called: At any time
- Parameters: none
- Each update:
{ cpu, ram, cpuTemperature, gpuTemperature, sources }, ornullwithout an active game:cpuis the game's share of the whole machine in % (0–100),ramits resident bytes, temperatures are °C ornull,sources{ cpuTemperature, gpuTemperature }says whether the host has each sensor - Shape:
Telemetryornull
fps.subscribe
- Kind: subscription
- Requires: capability
fps.read - When it can be called: At any time
- Parameters: none
- Each update:
{ fps, stale, status }:fpsa number ornull; the host setsstale3 s after the last sample;statusisready,waiting,unsupported,permission_denied,ambiguous,events_lostorunavailable - Shape:
Fps
media.subscribe
- Kind: subscription
- Requires: capability
media.read - When it can be called: At any time
- Parameters:
cover?: boolean - Each update:
nullwithout a player, or{ player, title, artists, playing, canPrevious, canPlayPause, canNext, cover }:playeran opaque ID,artistsa list,coveranasset:handle of at most 512 px ornull - Shape:
Mediaornull
media.previous
- Kind: call, answered once
- Requires: capability
media.control - When it can be called: Only during a user action
- Parameters:
player?: text ≤ 128 bytes - Result:
null;stale_contextwhenplayeris no longer current - Shape:
null
media.playPause
- Kind: call, answered once
- Requires: capability
media.control - When it can be called: Only during a user action
- Parameters:
player?: text ≤ 128 bytes - Result:
null;stale_contextwhenplayeris no longer current - Shape:
null
media.next
- Kind: call, answered once
- Requires: capability
media.control - When it can be called: Only during a user action
- Parameters:
player?: text ≤ 128 bytes - Result:
null;stale_contextwhenplayeris no longer current - Shape:
null
stopwatch.subscribe
- Kind: subscription
- Requires: capability
stopwatch.read - When it can be called: At any time
- Parameters: none
- Each update:
{ running, elapsedMs, at, shortcuts }, ornullwithout an active game;shortcuts{ toggle, reset, bound }holds host-formatted key chords - Shape:
Stopwatchornull
stopwatch.toggle
- Kind: call, answered once
- Requires: capability
stopwatch.control - When it can be called: Only during a user action
- Parameters: none
- Result: the new state, as in
stopwatch.subscribe;unavailablewhen the host cannot act - Shape:
Stopwatchornull
stopwatch.reset
- Kind: call, answered once
- Requires: capability
stopwatch.control - When it can be called: Only during a user action
- Parameters: none
- Result: the new state, as in
stopwatch.subscribe;unavailablewhen the host cannot act - Shape:
Stopwatchornull
notes.subscribe
- Kind: subscription
- Requires: capability
notes.read - When it can be called: At any time
- Parameters: none
- Each update:
{ active, notes }of the user's single notes document; each note{ id, title, body, items }, each item{ id, text, checked } - Shape:
Notes
notes.create
- Kind: call, answered once
- Requires: capability
notes.write - When it can be called: Only during a user action
- Parameters: none
- Result:
{ note }, a new empty active note titledNote {n}in the user's language;quota_exceededbeyond 8 - Shape:
CreatedNote
notes.select
- Kind: call, answered once
- Requires: capability
notes.write - When it can be called: Only during a user action
- Parameters:
note: text ≤ 128 bytes - Result:
null; the host stores the active note - Shape:
null
notes.setItem
- Kind: call, answered once
- Requires: capability
notes.write - When it can be called: Only during a user action
- Parameters:
note: text ≤ 128 bytes;item: text ≤ 128 bytes;checked: boolean - Result:
null
notes.delete
- Kind: call, answered once; the user confirms it first, in a dialog drawn by PlayerVox OverCrow
- Requires: capability
notes.write - When it can be called: Only during a user action
- Parameters:
note: text ≤ 128 bytes - Result:
null, orcancelledwhen the user declines - Shape:
null
playervox.score.subscribe
- Kind: subscription
- Requires: capability
playervox.score.read - When it can be called: At any time
- Parameters: none
- Each update:
{ state, name, score, grade, ratingsCount, criteria }:stateisidle,unsupported,loading,ready,no_ratings,not_foundorunavailable;criteria{ gameplay, art, tech }, each from 0 to 100 ornull - Shape:
Score
playervox.rating.subscribe
- Kind: subscription
- Requires: capability
playervox.rating.read - When it can be called: At any time
- Parameters: none
- Each update:
{ state, name, offline, rating }:stateisidle,unsupported,loading,readyorunavailable;ratingisnullbefore the user's first rating, or{ gameplay, art, tech, review, publishedAt, offsetMinutes }. Nothing is sent while the PlayerVox account is signed out, pending or expired. A published rating is sent again by the subscription. The host fills theplayervox.rating.publishcontrols from it - Shape:
RatingState
playervox.reviews.subscribe
- Kind: subscription
- Requires: capability
playervox.reviews.read - When it can be called: At any time
- Parameters: none
- Each update:
{ state, revision, offline }:stateisidle,unsupportedorready;revisionchanges whenever the reviews to read change (another game, another PlayerVox account, reviews changed on PlayerVox), so the widget reads its page again;offlinewhile PlayerVox is unreachable. Nothing is sent while the PlayerVox account is signed out, pending or expired. Holding this subscription is what keeps the host's reviews source running - Shape:
ReviewsState
playervox.reviews.page
- Kind: call, answered once
- Requires: capability
playervox.reviews.read - When it can be called: At any time
- Parameters:
page?: integer 1 to 100000;followedOnly?: boolean - Result:
{ gameName, items, page, totalPages, count }: three reviews of the active game per page, in the language of the host's interface; a page past the end answers the last page; each item{ id, author, grade, score, text, original, hidden, publishedAt, offsetMinutes },texttranslated when a translation exists,originalthe untranslated text of a translated review ornull, both cut by the host to 16 KiB. Each call reads its own page: the host keeps no page position or filter shared between widgets - Shape:
ReviewsPage
journal.subscribe
- Kind: subscription
- Requires: capability
journal.read - When it can be called: At any time
- Parameters: none
- Each update:
nullwithout an active game, or{ revision, notice }:revisionchanges whenever the merged journal of the active game changes (a session recorded or deleted, cloud sessions merged, the PlayerVox account or sync changed), so the widget reads its page again;noticeisnull,offline,storage_unavailable,full,expired,busyorunavailable. Holding this subscription is what keeps the host's journal source running - Shape:
JournalStateornull
journal.page
- Kind: call, answered once
- Requires: capability
journal.read - When it can be called: At any time
- Parameters:
cursor?: text ≤ 128 bytes - Result:
{ gameName, items, page, next, previous }: five local and cloud sessions of the active game, merged and deduplicated, newest first; withoutcursor, the first page; each item{ id, startedAt, offsetMinutes, durationMs, source }; cursors are host handles that stay valid for the widget whatever other widgets read, and a cursor past the end answers the last page - Shape:
JournalPage
journal.delete
- Kind: call, answered once; the user confirms it first, in a dialog drawn by PlayerVox OverCrow
- Requires: capability
journal.delete - When it can be called: Only during a user action
- Parameters:
session: text ≤ 128 bytes - Result:
null, orcancelledwhen the user declines;not_connectedfor a cloud session while PlayerVox is disconnected - Shape:
null
twitch.chat.subscribe
- Kind: subscription
- Requires: capability
twitch.chat.read - When it can be called: At any time
- Parameters: none
- Each update:
{ account, channel, joinState, failure, favorites, canSend, generation, reset, messages, removed, skipped }:accountissigned_out,pending,connectedorexpired(sign-in is drawn by the host);failureis the fixed category of afailedjoin; messages arrive as deltas, at most one update per 100 ms, withresetafter subscribing, a generation change or a show, and nothing while the widget is hidden; a faster chat is sampled,skippedcounting the new messages left out; each message{ id, author, color, badges, fragments, reply, deleted, receivedAt }with at most 16 fragments, emotes and badges asasset:handles for the current theme and scale - Shape:
TwitchChat
twitch.chat.join
- Kind: call, answered once
- Requires: capability
twitch.chat.read - When it can be called: Only during a user action
- Parameters:
channel: text ≤ 25 bytes - Result:
null; the host remembers the channel and rejoins it when the widget starts - Shape:
null
twitch.chat.leave
- Kind: call, answered once
- Requires: capability
twitch.chat.read - When it can be called: Only during a user action
- Parameters: none
- Result:
null; the host forgets the channel - Shape:
null
twitch.chat.favorite
- Kind: call, answered once
- Requires: capability
twitch.chat.read - When it can be called: Only during a user action
- Parameters:
channel: text ≤ 25 bytes;favorite: boolean - Result:
null;quota_exceededbeyond 20 - Shape:
null
Writes that go through a form
Saving a note, publishing a rating and sending a chat message are not in
this list: they are write intents, sent by a form from the values that
the user typed. See
forms that write user data.