get('enabled')) { $settings = [ 'access_token' => $config->get('access_token'), 'capture_uncaught' => $config->get('capture_uncaught'), 'capture_unhandled_rejections' => $config->get('capture_unhandled_rejections'), 'environment' => $config->get('environment'), 'rollbar_js_url' => $config->get('rollbar_js_url'), ]; // Extract host white list, if set, and add it to configuration. if ($hosts = $config->get('host_white_list')) { $host_list = explode(',', trim($hosts)); if (!empty($host_list)) { $settings['host_white_list'] = $host_list; } } // Allow alteration of the rollbar settings by other modules. \Drupal::moduleHandler()->alter('rollbar_settings', $settings); $attachments['#attached']['library'][] = 'rollbar/global'; $attachments['#attached']['drupalSettings']['rollbar'] = $settings; } }