Extensions offer a way to provide custom implementations of certain parts of the CameraKit SDK.
This enables more advanced use-cases, in which the default behavior of the SDK is substantially altered. For example,
replacing the default implementation that loads remote lens assets with a custom implementation that returns
different assets based on some business logic within the application.
An extension is implemented as a PartialContainer – a collection of factory functions, each with its own
dependencies, which each provide some "Service". A Service can be of any type, and the CameraKit SDK defines its
own Services, some of which can be overridden by providing a custom implementation of the type via an extension.
Here's an example of how extensions might be used:
This also enables greater modularity – the person/team creating the extension can do so in their own package, which
could be shared by many applications that all require the same functionality.
Returns PartialContainer
A PartialContainer which can be used to create a collection of Services, and can later be provided
to CameraKit's DI container during bootstrapCameraKit.
Extensions offer a way to provide custom implementations of certain parts of the CameraKit SDK.
This enables more advanced use-cases, in which the default behavior of the SDK is substantially altered. For example, replacing the default implementation that loads remote lens assets with a custom implementation that returns different assets based on some business logic within the application.
An extension is implemented as a PartialContainer – a collection of factory functions, each with its own dependencies, which each provide some "Service". A Service can be of any type, and the CameraKit SDK defines its own Services, some of which can be overridden by providing a custom implementation of the type via an extension.
Here's an example of how extensions might be used:
This also enables greater modularity – the person/team creating the extension can do so in their own package, which could be shared by many applications that all require the same functionality.