Custom hook to access the CameraKit state and functionality.

  • Returns {
        applyLens: (
            lensId: string,
            launchData?: LensLaunchData,
        ) => Promise<boolean>;
        isSessionReady: boolean;
        loadLensGroup: (groupId: string) => Promise<Lens[]>;
        removeLens: () => Promise<boolean>;
        takeSnapshot: (
            format: ImageFormats,
            quality: number,
        ) => Promise<{ uri: string }>;
        takeVideo: () => { stop: () => Promise<{ uri: string }> };
    }

    An object containing various camera-related functions and properties.

    • applyLens: (lensId: string, launchData?: LensLaunchData) => Promise<boolean>

      Applies a lens with the specified ID and launch data.

      If any launchParam value is not a string, number, or array of strings or numbers.

    • isSessionReady: boolean
    • loadLensGroup: (groupId: string) => Promise<Lens[]>
    • removeLens: () => Promise<boolean>

      Removes the currently applied lens.

    • takeSnapshot: (format: ImageFormats, quality: number) => Promise<{ uri: string }>

      Takes a snapshot in the specified format and quality.

    • takeVideo: () => { stop: () => Promise<{ uri: string }> }

      Takes a video.