SDK Developer Guide
Combine the design capabilities of Ceros with the power of object-oriented programming
What is the Ceros SDK?
The Ceros Software Development Kit (SDK) is a set of tools that help you unlock creative solutions to problems. By leveraging our prewritten SDK Extensions and this guide, you can extend the native functionality of the Ceros platform.
What can you use the SDK for?
- Building a quiz
- Gamifying your experience with scorekeeping, object collection and more
- Building a calculator
- Granular analytics tracking
- Generating a social share link
- Controlling and manipulating audio
- …. and more!
Who is it for?
Examples of the core functionality of the SDK
- Find pages, layers, smartgroups, or other components by ID or by tag
- Navigate between pages dynamically
- Listen for events like clicks, visibility changes, video plays, and more
- Get properties of objects like width, height and position
- Start and pause animations and videos
- Show and hide layers, objects and smartgroups
- Get and set the text inside text boxes
The SDK Panel is the place to locate identifying information about your Experience as well as assign Tagsand Payloads to help you programmatically handle your content.
With the Ceros SDK, there are two basic ways to identify something: Tags and IDs. SDK Tags are values you can enter in the SDK Panel in order to identify an object or page. With out pre-built quiz extensions, for example, we identify each question page with the Tag question and each result page with results so that they can be managed easily within the code. After typing in a Tag, hit enter to apply it to the target object or page.
NOTE: You can add multiple tags to a single target object.
Component, Page, and Experience IDs
In Ceros, each Experience, Page, and Component have unique identifiers. These IDs can be used to locate a specific instance of your target in order to read its attributes or manipulate it.
Every Page and Component has an information entry area called a Payload. In contrast to Tags, which are commonly applied to multiple targets and used for classification, Payloads generally contain unique information. For instance, our SDK Audio plugin uses the payload field to hold the URL of an MP3 file that the Studio reads in order to play sound in an Experience.
NOTE: A Component or Page can only have one Payload.
To start using the power of the SDK, we have to reference it. Our standard method is to use RequireJS to point at the Ceros SDK with an Anonymous Module Definition (AMD). Example code below! There are two ways to integrate your code with a Ceros Experience. Take a look below and choose the one that best fits your development workflow.
Referencing the Ceros SDK
The easiest way to make sure your code is scoped correctly is to wrap it in an anonymous function that is immediately invoked to run the code when the page loads.
Writing SDK Code Directly in the Experience
You can insert your own code into an Experience by using the Custom HTML tab in the Studio’s Settings panel. Set up some opening and closing
script HTML tags, then you can start writing your own custom code.