Choreo Display SDK - v0.2.0
    Preparing search index...

    Interface IChoreoSDK

    The main SDK interface that external apps use to interact with Choreo Display. Both the real SDK and mock SDK implement this interface.

    interface IChoreoSDK {
        log?: {
            debug(
                message: string,
                context?: Record<string, unknown>,
            ): Promise<{ ok: boolean }>;
            error(
                message: string,
                context?: Record<string, unknown>,
            ): Promise<{ ok: boolean }>;
            info(
                message: string,
                context?: Record<string, unknown>,
            ): Promise<{ ok: boolean }>;
            warn(
                message: string,
                context?: Record<string, unknown>,
            ): Promise<{ ok: boolean }>;
            (
                level: "error" | "debug" | "info" | "warn",
                message: string,
                context?: Record<string, unknown>,
            ): Promise<{ ok: boolean }>;
        };
        destroy?(): void;
        detectFace?(
            imageBitmap: ImageBitmap,
            options?: FaceDetectionOptions,
        ): Promise<FaceDetectionResult>;
        detectFacePresence?(
            imageBitmap: ImageBitmap,
            options?: FaceDetectionOptions,
        ): Promise<FacePresenceResult>;
        exitApp(options?: ExitOptions): Promise<ExitResult>;
        generateQRCode(
            options?: { content?: string; recordingId?: string },
        ): Promise<QRCodeResult>;
        getCameraStream(
            options?: { height?: number; width?: number },
        ): Promise<CameraStreamInfo>;
        getConfig(): Promise<SDKConfig>;
        getRecording(recordingId?: string): Promise<RecordingInfo>;
        getRecordingStatus(): Promise<RecordingStatus>;
        getSelectedCamera(): Promise<CameraInfo>;
        getUploadStatus(taskId: string): Promise<UploadStatus>;
        getVideos(): Promise<VideoInfo[]>;
        getVideoUrl(videoId: string): Promise<string>;
        isReady(): boolean;
        listVideos(): Promise<VideoInfo[]>;
        navigateTo(slideId: string): Promise<NavigateResult>;
        off<T extends SDKEventType>(
            event: T,
            callback: (data: SDKEventData[T]) => void,
        ): void;
        on<T extends SDKEventType>(
            event: T,
            callback: (data: SDKEventData[T]) => void,
        ): void;
        once<T extends SDKEventType>(
            event: T,
            callback: (data: SDKEventData[T]) => void,
        ): void;
        playVideo(videoId: string): Promise<PlayVideoResult>;
        queueUpload(
            options: { recordingId?: string; uploadUrl: string },
        ): Promise<UploadResult>;
        ready(): Promise<boolean>;
        releaseCamera(): Promise<void>;
        releaseUrl?(url: string): void;
        startRecording(
            options?: { durationMs?: number },
        ): Promise<RecordingStartResult>;
        stopRecording(): Promise<StopRecordingResult>;
    }
    Index
    log?: {
        debug(
            message: string,
            context?: Record<string, unknown>,
        ): Promise<{ ok: boolean }>;
        error(
            message: string,
            context?: Record<string, unknown>,
        ): Promise<{ ok: boolean }>;
        info(
            message: string,
            context?: Record<string, unknown>,
        ): Promise<{ ok: boolean }>;
        warn(
            message: string,
            context?: Record<string, unknown>,
        ): Promise<{ ok: boolean }>;
        (
            level: "error" | "debug" | "info" | "warn",
            message: string,
            context?: Record<string, unknown>,
        ): Promise<{ ok: boolean }>;
    }

    Send a log message to the parent app's logger (Sentry + console). Logs are tagged with source: 'external-app', the app URL, and slide name. Silently fails if the parent doesn't support the log method (backward compatible).

    Type Declaration

      • (
            level: "error" | "debug" | "info" | "warn",
            message: string,
            context?: Record<string, unknown>,
        ): Promise<{ ok: boolean }>
      • Parameters

        • level: "error" | "debug" | "info" | "warn"

          Log level: 'debug', 'info', 'warn', 'error'

        • message: string

          Log message

        • Optionalcontext: Record<string, unknown>

          Optional context data

        Returns Promise<{ ok: boolean }>

    • debug: function
      • Debug log (console only, not sent to Sentry)

        Parameters

        • message: string
        • Optionalcontext: Record<string, unknown>

        Returns Promise<{ ok: boolean }>

    • error: function
      • Error log (sent to Sentry Logs + creates Sentry issue)

        Parameters

        • message: string
        • Optionalcontext: Record<string, unknown>

        Returns Promise<{ ok: boolean }>

    • info: function
      • Info log

        Parameters

        • message: string
        • Optionalcontext: Record<string, unknown>

        Returns Promise<{ ok: boolean }>

    • warn: function
      • Warning log (sent to Sentry Logs)

        Parameters

        • message: string
        • Optionalcontext: Record<string, unknown>

        Returns Promise<{ ok: boolean }>

    await sdk.log('info', 'Face detected', { phase: 3 });
    await sdk.log('error', 'Camera failed', { error: 'NotAllowedError' });
    • Tear down the SDK: clear caches, cancel timers, remove listeners. Safe to call multiple times. Optional — older SDK builds may not implement this.

      Returns void

    • Run full face detection on an ImageBitmap. Returns a 128-D descriptor (ArrayBuffer) and bounding box. The parent hosts the face-api.js worker — models persist across iframe reloads.

      Parameters

      Returns Promise<FaceDetectionResult>

      const bitmap = await createImageBitmap(canvas);
      const { descriptor, box } = await sdk.detectFace(bitmap);
      if (descriptor) {
      const vec = new Float32Array(descriptor);
      }
    • Run lightweight face presence detection (no descriptor). Faster than detectFace — use for "is someone there?" checks.

      Parameters

      Returns Promise<FacePresenceResult>

      const bitmap = await createImageBitmap(canvas);
      const { detected } = await sdk.detectFacePresence(bitmap);
    • Exit the external app and signal result to the gallery. The gallery configuration maps results to target slides.

      Parameters

      Returns Promise<ExitResult>

      // Success - gallery navigates to success slide
      await sdk.exitApp({ result: 'success' });

      // Error with data
      await sdk.exitApp({ result: 'error', data: { message: 'Failed' } });
    • Generate a QR code. If no options provided, generates QR for the last recording.

      Parameters

      • Optionaloptions: { content?: string; recordingId?: string }

      Returns Promise<QRCodeResult>

    • Get camera stream info. The parent window manages the actual MediaStream.

      Parameters

      • Optionaloptions: { height?: number; width?: number }

      Returns Promise<CameraStreamInfo>

    • Get a recording by ID for playback. If no recordingId provided, returns the last recording.

      Parameters

      • OptionalrecordingId: string

      Returns Promise<RecordingInfo>

    • Get URL for a specific video.

      Parameters

      • videoId: string

      Returns Promise<string>

    • Check if the SDK is ready.

      Returns boolean

    • Queue a recording for background upload. The upload will continue even if the tab is closed.

      Parameters

      • options: { recordingId?: string; uploadUrl: string }

      Returns Promise<UploadResult>

    • Wait for the SDK to be ready. Call this before using any other SDK methods.

      Returns Promise<boolean>

      true when ready

    • Release the camera stream.

      Returns Promise<void>

    • Release an object URL previously returned by getRecording / playVideo. Allows the SDK to revoke blob URLs and free memory. Optional — older SDK builds may not implement this.

      Parameters

      • url: string

      Returns void

    • Start recording from the camera. Recording will automatically stop after the specified duration. Listen for 'recordingComplete' event for the result.

      Parameters

      • Optionaloptions: { durationMs?: number }

      Returns Promise<RecordingStartResult>