LiformaExperience

The canonical Svelte component for embedding Avatar Experiences.

Overview

<LiformaExperience> is the hello-world integration for Svelte apps. It calls Experience.startSession and attach internally.

Basic usage

App.svelte
<script>
  import { LiformaExperience } from '@liforma/client/svelte';
<\/script>

<LiformaExperience experienceId="exp_01DEMO1SPANISHCAFE" />

Props

PropTypeDescription
experienceIdstringPublic experience ID. SDK mints session via /v1/public-sessions.
manifestSessionManifestPre-minted manifest from your backend. See SSR warning below.
sessionEndpointstringSame-origin route that mints a manifest. For authenticated embeds.
acceptCredentialExposurebooleanRequired when passing a manifest that includes sessionToken.

Authenticated embed

<LiformaExperience
  experienceId="exp_01DEMO1SPANISHCAFE"
  sessionEndpoint="/api/liforma-session"
/>

Container sizing

The component fills its parent container. Set explicit dimensions on the parent for embedded layouts, or use full viewport for immersive experiences.

<div style="width: 400px; height: 600px;">
  <LiformaExperience experienceId="exp_01DEMO1SPANISHCAFE" />
</div>

SSR safety

Do not pass credential-bearing manifests through server load functions into page data. The sessionToken would be embedded in HTML. Prefer experienceId for public embeds or a same-origin sessionEndpoint.