Function bootstrapCameraKit

  • Bootstrap CameraKit. This will download the WebAssembly code which powers CameraKit's rendering engine, and return an instance of CameraKit.

    CameraKit must be provided with some configuration (the application's API token), and there are some additional configurations which are optional.

    Descriptions of the available configurations can be found in the documentation for CameraKitBootstrapConfiguration


    There is also a second, more advanced way to modify CameraKit to provide greater flexibility to support less common use cases.

    This requires some knowledge of CameraKit's dependency injection system, and allows applications to provide their own custom implementations of certain CameraKit components. This functionality will only be needed by applications with very specific, more advanced requirements.

    Parameters

    Returns Promise<CameraKit>

    A CameraKit instance, which is the entry point to CameraKit's API.

    Example

    // The most common way to bootstrap:
    const cameraKit = await bootstrapCameraKit({ apiToken: myApiToken })

    // For special advanced use-cases, it is possible to provide custom implementations for certain CameraKit components.
    const cameraKit = await bootstrapCameraKit(config, (container) => {
    return container.provides(myCustomRemoteMediaAssetLoaderFactory)
    })

    Throws

Generated using TypeDoc