getConfiguration method

JSObject getConfiguration(
  1. MethodCall call
)

Maps the configuration settings for the Amplitude SDK to a JavaScript object.

For more details on configuring the SDK, refer to the official documentation: https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2#configure-the-sdk

The pure-Dart shaping (autocapture, logLevel, serverZone, defaultTracking) lives in transformWebConfiguration so it can be unit tested without the chrome platform; this method only handles the jsify() conversion.

Returns a JavaScript object containing the configuration settings.

Implementation

JSObject getConfiguration(MethodCall call) {
  final configuration = Map<String, dynamic>.from(call.arguments as Map);
  return transformWebConfiguration(configuration).jsify() as JSObject;
}