Instantiate client in a non-Sitecore context
In container-based environments, the xConnect API is not publicly exposed.
The xConnect Client API is portable and can be used in a non-Sitecore context. The following example demonstrates how to instantiate the client from a console application.
Only trusted clients with the correct client certificates can communicate with xConnect. If you want to write to xConnect from a mobile application, you must set up an intermediary server that collects data from the application and submits that data to xConnect at regular intervals. You cannot write directly to xConnect from a mobile device.
Do not initialize the XConnectConfiguration object more than one time to avoid unnecessary resource consumption and potential conflicts.
Using a custom model
In a Sitecore context, the xConnect Client API uses a runtime model that is assembled from all the models available in configuration. In a non-Sitecore context, you must pass the model that you want to work with into XConnectClientConfiguration:
You can instantiate an XdbRuntimeModel object with an array of models.