From 4479f9baf56c2a924de8b20515c4215039603753 Mon Sep 17 00:00:00 2001 From: Dmitriev Sergey Date: Sun, 26 Jun 2022 00:40:05 +0700 Subject: [PATCH] feat: options for GA and linkPreviewApiServers (#1186) Co-authored-by: sergey <110@mobilon.ru> --- src/api/layers/host.layer.ts | 3 +++ src/config/create-config.ts | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/api/layers/host.layer.ts b/src/api/layers/host.layer.ts index aa99a1bf8..153cb4acf 100644 --- a/src/api/layers/host.layer.ts +++ b/src/api/layers/host.layer.ts @@ -140,6 +140,9 @@ export class HostLayer { const options = { deviceName: this.options.deviceName, + disableGoogleAnalytics: this.options.disableGoogleAnalytics, + googleAnalyticsId: this.options.googleAnalyticsId, + linkPreviewApiServers: this.options.linkPreviewApiServers, }; await evaluateAndReturn( diff --git a/src/config/create-config.ts b/src/config/create-config.ts index 323cd803e..106dd9527 100644 --- a/src/config/create-config.ts +++ b/src/config/create-config.ts @@ -136,7 +136,27 @@ export interface CreateConfig { * @default 'WPPConnect' */ deviceName?: string | false; + + /** + * Set custom Link Preview API servers + * @default null + */ + linkPreviewApiServers?: string[] | null; + + /** + * Disable custom Google Analytics + * @default true + */ + disableGoogleAnalytics?: boolean; + + /** + * Custom Google Analytics Tracker Id, like 'G-XXXXXXXXXX' + * collect analytics data to your GA account + * @default null + */ + googleAnalyticsId?: string | null; } + export const defaultOptions: CreateConfig = { folderNameToken: './tokens', headless: true, @@ -156,4 +176,7 @@ export const defaultOptions: CreateConfig = { tokenStore: 'file', whatsappVersion: '2.2220.x', deviceName: false, + linkPreviewApiServers: null, + disableGoogleAnalytics: true, + googleAnalyticsId: null, };