El SDK de Interartive
Progreso, espacios de contenido, finalización, pausas publicitarias, compartir en tiempo real.
El entorno de ejecución agrega window.Interartive a cada experiencia. Todo es opcional.
// Tell Interartive the experience was completed (unlocks the next in a path, post-roll ads, analytics)
Interartive.complete();
// Progressive experiences: save and load where people are
Interartive.progress.save({ lesson: 4, xp: 120 }, { percent: 40, level: 'Lesson 4' });
Interartive.progress.load(data => { if (data) startAt(data.lesson); });
// Customizable experiences: receive people's own content
Interartive.content(slots => { (slots.artworks || []).forEach(a => hang(a.url, a.name)); });
// A natural break (between levels): Interartive may show one ad, then calls you back
Interartive.adBreak(() => nextLevel());
// Realtime shared: one world for everyone in the session
Interartive.together.on('state', s => render(s));
Interartive.together.setState({ color: 'red' });