API Reference
List of functions and variables exposed by the Stagecast object, the entry point to the MDK library.
Last updated
Was this helpful?
List of functions and variables exposed by the Stagecast object, the entry point to the MDK library.
Last updated
Was this helpful?
The Stagecast
object is library entry point and comes with some getter function that allows to access the Moment context data. The context data is grouped in the section.
You can also get directly to the sub sections:
Your HTML-based application will get its running context from the Moment. The moment is derived from a MomentClass which belongs to a specific Event.
getEventId(): string
Returns the current event id. The id is a UUIDv4.
getUserId(): string
Returns the User identification which most of the times is the email.
getMomentId(): string
Returns the Moment id as a string. The id is a UUIDv4.
getMomentClassId(): string
Returns the MomentClass id. The id is a UUIDv4.
isActive(): boolean
Tells whether the Moment is active or not, ie. whether the moment has been stopped by the event organizer from the launchpad. It can be used to render different views, for example:
Often, this is used to display the moment results. An example could be a poll: as long as isActive()
returns true
the user can express a vote. When the moment stops and isActive()
return false
, the application could display the poll results or just the user vote.
getCoordinates(): [lat, long]
This function returns the user coordinates as an array of string where the first entry is the latitude and the second is the longitude. The coordinates can be used to activate some functionality depending on the user's location.
In case the wrapper mobile app, or the wrapper website can't get this values, the default ['0', '0']
is returned.
bannerInjector
objectinjectAdvertisementBanner(selectors: string[])
The function injects the credits
text and the sponsor logos
specified in the Moment Class configuration window in the organizer dashboard.
Params:
selectors
: list of CSS3 selectors in which the advertisement images will be injected.
If your moment doesn't support branding, you will have to specify that in the .