/// <summary> /// Initializes the Amplitude with your Amplitude api key and optional user ID. /// </summary> public void Initialize(string apiKey, string userId = null) { if (impl != null) { throw new Exception("Amplitude instance is already initialized!"); } impl = String.IsNullOrEmpty(Name) ? Amplitude.Instance() : Amplitude.InstanceWithName(Name); if (String.IsNullOrEmpty(userId)) { impl.InitializeApiKey(apiKey); } else { impl.InitializeApiKey(apiKey, userId); } }