Quickstart
Put a Jami3D experience in your page with a test key, in plain HTML, React or Vue.
1. Get a test key
Open Integration and create a publishable key in test mode. List the origin your page is served from — a test key also takes http://localhost and http://127.0.0.1, with a port or :* for every port. A publishable key belongs in pages: it is public by design, and only the origins it lists may frame the player with it.
2. Add the player
Install the SDK from npm, or load its CDN build in a plain page. Signed in, the code below already holds your test key and your first live project.
Sign in to see your own test key and project in this code. Sign in
<div id="stage"></div>
<script src="https://cdn.jami.live/sdk/v1/jami3d.js" crossorigin="anonymous"></script>
<script>
Jami3D.createPlayer("#stage", {
projectId: "YOUR_PROJECT_ID",
publishableKey: "pk_test_…",
});
</script>The player's facade paints at once — the poster, the title, Play and what in the experience is AI — and the Live Room's iframe mounts when the player scrolls into view (lazy). A container with a height of its own is filled; one without gets a 16 / 9 height (aspectRatio).
3. Hear what happens
Every event the viewer causes reaches your page: chapters (beatenter), quiz answers (quizresult, graded by the server — the answer key never reaches a page), the end of the story (sessioncomplete). Commands drive the player from your page, and each answers what it did.
import { createPlayer, JamiPlayerError } from "jami3d";
const player = createPlayer("#stage", {
projectId: "0199c4a0-0000-7000-8000-0000000000a1",
publishableKey: "pk_test_…",
start: { beat: "cats_book" },
results: "hide",
});
player.on("beatenter", (event) => console.log("Beat", event.alias || event.beatId));
player.on("quizresult", (event) => console.log(event.questionId, event.correct, event.points));
player.on("sessioncomplete", () => console.log("the story ended"));
const stop = player.on("*", (event) => console.debug(event.type));
try {
await player.ready; // the experience is on screen
const moved = await player.goToBeat("cats_book");
if (moved.kind === "gate-locked") console.log("finish the Beat before", moved.beatId);
} catch (error) {
if (error instanceof JamiPlayerError) console.warn("not here:", error.code);
}
stop();The Player SDK reference lists every option, command and event. A command that cannot run rejects with a JamiPlayerError whose code says why.
4. Go live
- Create a live publishable key with your site's
https://origins. Every page that frames the player is an ancestor the key must list — an LMS that wraps your page in its own frame too. - Live AI in an embed is paid by the key's account. Each new live key starts with a daily spending cap (5% of the plan's monthly credits) you can raise; scripted playback never costs anything.
- Send your site's own security headers? Add what the player needs: CSP and Permissions-Policy.