Skip to content

Commit

Permalink
feat: options for GA and linkPreviewApiServers (#1186)
Browse files Browse the repository at this point in the history
Co-authored-by: sergey <110@mobilon.ru>
  • Loading branch information
antirek and sergey committed Jun 25, 2022
1 parent 940ce2c commit 4479f9b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/layers/host.layer.ts
Expand Up @@ -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(
Expand Down
23 changes: 23 additions & 0 deletions src/config/create-config.ts
Expand Up @@ -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,
Expand All @@ -156,4 +176,7 @@ export const defaultOptions: CreateConfig = {
tokenStore: 'file',
whatsappVersion: '2.2220.x',
deviceName: false,
linkPreviewApiServers: null,
disableGoogleAnalytics: true,
googleAnalyticsId: null,
};

0 comments on commit 4479f9b

Please sign in to comment.