2026-08-12 14:03:44 +03:00
|
|
|
using RudderSdk.Core;
|
|
|
|
|
|
|
|
|
|
namespace RudderSdk.Unity
|
|
|
|
|
{
|
|
|
|
|
public static class RudderUnityClientFactory
|
|
|
|
|
{
|
|
|
|
|
public static RudderClient Create(RudderUnityClientOptions options)
|
|
|
|
|
{
|
|
|
|
|
var executor = options.RequestExecutor ?? new UnityWebRequestExecutor(options.TimeoutSeconds);
|
|
|
|
|
|
|
|
|
|
var clientOptions = new RudderClientOptions
|
|
|
|
|
{
|
|
|
|
|
BaseUrl = options.BaseUrl,
|
|
|
|
|
ProjectKey = options.ProjectKey,
|
|
|
|
|
Logger = new UnityLoggerAdapter(options.LoggerSink ?? new UnityDebugLoggerSink()),
|
|
|
|
|
Transport = new UnityTransportAdapter(options.BaseUrl, executor),
|
|
|
|
|
TokenStore = new UnityTokenStoreAdapter(options.KeyValueStore),
|
|
|
|
|
DeviceIdProvider = new UnityDeviceIdProvider(),
|
2026-09-04 14:23:38 +03:00
|
|
|
Clock = new UnityClock()
|
2026-08-12 14:03:44 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return new RudderClient(clientOptions);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|