Socket
Socket
Sign inDemoInstall

@amplitude/analytics-types

Package Overview
Dependencies
Maintainers
21
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/analytics-types - npm Package Compare versions

Comparing version 2.5.0 to 2.5.1

114

lib/cjs/config/browser.d.ts

@@ -9,13 +9,62 @@ import { UserSession } from '../user-session';

export interface ExternalBrowserConfig extends Config {
/**
* An app version for events tracked. This can be the version of your application.
* @defaultValue `undefined`
*/
appVersion?: string;
/**
* The default event tracking configuration.
* See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.
* @defaultValue `true`
*/
defaultTracking?: boolean | DefaultTrackingOptions;
/**
* The identifier for the device running your application.
* @defaultValue `UUID()`
*/
deviceId?: string;
/**
* Configuration for cookie.
*/
cookieOptions?: CookieOptions;
/**
* The storage for user identify.
* @defaultValue `"cookie"`
*/
identityStorage?: IdentityStorageType;
/**
* The partner identifier.
* Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.
* @defaultValue `undefined`
*/
partnerId?: string;
/**
* The custom Session ID for the current session.
* @defaultValue `timestamp`
*/
sessionId?: number;
/**
* The period of inactivity from the last tracked event before a session expires in milliseconds.
* @defaultValue `1,800,000` (30 minutes)
*/
sessionTimeout: number;
/**
* The configurations for tracking additional properties.
* See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.
*/
trackingOptions: TrackingOptions;
/**
* Network transport mechanism used to send events.
* @defaultValue `"fetch"`
*/
transport?: 'fetch' | 'xhr' | 'beacon';
/**
* The identifier for the user being tracked.
* @defaultValue `undefined`
*/
userId?: string;
/**
* User's Nth instance of performing a default Page Viewed event within a session.
* Used for landing page analysis.
*/
pageCounter?: number;

@@ -28,26 +77,89 @@ }

transportProvider: Transport;
pageCounter?: number;
}
export interface DefaultTrackingOptions {
/**
* Enables/disables marketing attribution tracking or config with detailed attribution options.
* @defaultValue `true`
*/
attribution?: boolean | AttributionOptions;
/**
* Enables/disables form downloads tracking.
* @defaultValue `true`
*/
fileDownloads?: boolean;
/**
* Enables/disables form interaction tracking.
* @defaultValue `true`
*/
formInteractions?: boolean;
/**
* Enables/disables default page view tracking.
* @defaultValue `true`
*/
pageViews?: boolean | PageTrackingOptions;
/**
* Enables/disables session tracking.
* @defaultValue `true`
*/
sessions?: boolean;
}
export interface TrackingOptions {
/**
* Enables/disables ip address tracking.
* @defaultValue `true`
*/
ipAddress?: boolean;
/**
* Enables/disables language tracking.
* @defaultValue `true`
*/
language?: boolean;
/**
* Enables/disables plantform tracking.
* @defaultValue `true`
*/
platform?: boolean;
}
export interface AttributionOptions {
/**
* The rules to determine which referrers are excluded from being tracked as traffic source.
* @defaultValue `[/your-domain\.com$/]`
*/
excludeReferrers?: (string | RegExp)[];
/**
* The value to represent undefined/no initial campaign parameter for first-touch attribution.
* @defaultValue `"EMPTY"`
*/
initialEmptyValue?: string;
/**
* The flag of if Amplitude to start a new session if any campaign parameter changes.
* @defaultValue `false`
*/
resetSessionOnNewCampaign?: boolean;
}
export interface CookieOptions {
/**
* The domain property of cookies created.
* @defaultValue `Your top level domain`
*/
domain?: string;
/**
* The expiration of cookies created in days.
* @defaultValue `365`
*/
expiration?: number;
/**
* How cookies are sent with cross-site requests.
* @defaultValue `"Lax"`
*/
sameSite?: 'Strict' | 'Lax' | 'None';
/**
* The flag of if send cookies over secure protocols.
* @defaultValue `false`
*/
secure?: boolean;
/**
* The flag of if upgrade the cookies created by maintenance Browser SDK.
* @defaultValue `true`
*/
upgrade?: boolean;

@@ -54,0 +166,0 @@ }

@@ -10,18 +10,74 @@ import { Event } from '../event';

export interface Config {
/**
* Your Amplitude Project API key.
*/
apiKey: string;
/**
* The interval of uploading events to Amplitude in milliseconds.
*/
flushIntervalMillis: number;
/**
* The maximum number of retries for failed upload attempts. This is only applicable to retryable errors.
*/
flushMaxRetries: number;
/**
* The maximum number of events that are batched in a single upload attempt.
*/
flushQueueSize: number;
/**
* The instance name. For tracking events to multiple Amplitude projects in your application.
*/
instanceName?: string;
/**
* Level of logs to be printed in the developer console.
* Valid values are `LogLevel.None`, `LogLevel.Error`, `LogLevel.Warn`, `LogLevel.Verbose`, `LogLevel.Debug`
*/
logLevel: LogLevel;
/**
* A custom Logger class to emit log messages to desired destination.
*/
loggerProvider: Logger;
/**
* The minimum length for the value of userId and deviceId properties.
*/
minIdLength?: number;
/**
* Whether the SDK is connected to network.
*/
offline?: boolean | typeof OfflineDisabled;
/**
* The flag to opt this device out of Amplitude tracking.
* If this flag is set, no additional information will be stored for the user.
*/
optOut: boolean;
/**
* Tracking plan properties.
* Amplitude internal use.
*/
plan?: Plan;
/**
* Ingestion metadata.
* Amplitude internal use.
*/
ingestionMetadata?: IngestionMetadata;
/**
* The URL where events are upload to.
*/
serverUrl?: string;
/**
* The Amplitude server zone.
* Set this to EU for Amplitude projects created in EU data center.
*/
serverZone?: ServerZoneType;
/**
* The storage provider to persist unsent events.
*/
storageProvider?: Storage<Event[]>;
/**
* A customer Transport Class for sending data to a server.
*/
transportProvider: Transport;
/**
* The flag of whether to upload events to Batch API instead of the default HTTP V2 API.
*/
useBatch: boolean;

@@ -28,0 +84,0 @@ }

@@ -9,13 +9,62 @@ import { UserSession } from '../user-session';

export interface ExternalBrowserConfig extends Config {
/**
* An app version for events tracked. This can be the version of your application.
* @defaultValue `undefined`
*/
appVersion?: string;
/**
* The default event tracking configuration.
* See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events}.
* @defaultValue `true`
*/
defaultTracking?: boolean | DefaultTrackingOptions;
/**
* The identifier for the device running your application.
* @defaultValue `UUID()`
*/
deviceId?: string;
/**
* Configuration for cookie.
*/
cookieOptions?: CookieOptions;
/**
* The storage for user identify.
* @defaultValue `"cookie"`
*/
identityStorage?: IdentityStorageType;
/**
* The partner identifier.
* Amplitude requires the customer who built an event ingestion integration to add the partner identifier to partner_id.
* @defaultValue `undefined`
*/
partnerId?: string;
/**
* The custom Session ID for the current session.
* @defaultValue `timestamp`
*/
sessionId?: number;
/**
* The period of inactivity from the last tracked event before a session expires in milliseconds.
* @defaultValue `1,800,000` (30 minutes)
*/
sessionTimeout: number;
/**
* The configurations for tracking additional properties.
* See {@link https://www.docs.developers.amplitude.com/data/sdks/browser-2/#optional-tracking}.
*/
trackingOptions: TrackingOptions;
/**
* Network transport mechanism used to send events.
* @defaultValue `"fetch"`
*/
transport?: 'fetch' | 'xhr' | 'beacon';
/**
* The identifier for the user being tracked.
* @defaultValue `undefined`
*/
userId?: string;
/**
* User's Nth instance of performing a default Page Viewed event within a session.
* Used for landing page analysis.
*/
pageCounter?: number;

@@ -28,26 +77,89 @@ }

transportProvider: Transport;
pageCounter?: number;
}
export interface DefaultTrackingOptions {
/**
* Enables/disables marketing attribution tracking or config with detailed attribution options.
* @defaultValue `true`
*/
attribution?: boolean | AttributionOptions;
/**
* Enables/disables form downloads tracking.
* @defaultValue `true`
*/
fileDownloads?: boolean;
/**
* Enables/disables form interaction tracking.
* @defaultValue `true`
*/
formInteractions?: boolean;
/**
* Enables/disables default page view tracking.
* @defaultValue `true`
*/
pageViews?: boolean | PageTrackingOptions;
/**
* Enables/disables session tracking.
* @defaultValue `true`
*/
sessions?: boolean;
}
export interface TrackingOptions {
/**
* Enables/disables ip address tracking.
* @defaultValue `true`
*/
ipAddress?: boolean;
/**
* Enables/disables language tracking.
* @defaultValue `true`
*/
language?: boolean;
/**
* Enables/disables plantform tracking.
* @defaultValue `true`
*/
platform?: boolean;
}
export interface AttributionOptions {
/**
* The rules to determine which referrers are excluded from being tracked as traffic source.
* @defaultValue `[/your-domain\.com$/]`
*/
excludeReferrers?: (string | RegExp)[];
/**
* The value to represent undefined/no initial campaign parameter for first-touch attribution.
* @defaultValue `"EMPTY"`
*/
initialEmptyValue?: string;
/**
* The flag of if Amplitude to start a new session if any campaign parameter changes.
* @defaultValue `false`
*/
resetSessionOnNewCampaign?: boolean;
}
export interface CookieOptions {
/**
* The domain property of cookies created.
* @defaultValue `Your top level domain`
*/
domain?: string;
/**
* The expiration of cookies created in days.
* @defaultValue `365`
*/
expiration?: number;
/**
* How cookies are sent with cross-site requests.
* @defaultValue `"Lax"`
*/
sameSite?: 'Strict' | 'Lax' | 'None';
/**
* The flag of if send cookies over secure protocols.
* @defaultValue `false`
*/
secure?: boolean;
/**
* The flag of if upgrade the cookies created by maintenance Browser SDK.
* @defaultValue `true`
*/
upgrade?: boolean;

@@ -54,0 +166,0 @@ }

@@ -10,18 +10,74 @@ import { Event } from '../event';

export interface Config {
/**
* Your Amplitude Project API key.
*/
apiKey: string;
/**
* The interval of uploading events to Amplitude in milliseconds.
*/
flushIntervalMillis: number;
/**
* The maximum number of retries for failed upload attempts. This is only applicable to retryable errors.
*/
flushMaxRetries: number;
/**
* The maximum number of events that are batched in a single upload attempt.
*/
flushQueueSize: number;
/**
* The instance name. For tracking events to multiple Amplitude projects in your application.
*/
instanceName?: string;
/**
* Level of logs to be printed in the developer console.
* Valid values are `LogLevel.None`, `LogLevel.Error`, `LogLevel.Warn`, `LogLevel.Verbose`, `LogLevel.Debug`
*/
logLevel: LogLevel;
/**
* A custom Logger class to emit log messages to desired destination.
*/
loggerProvider: Logger;
/**
* The minimum length for the value of userId and deviceId properties.
*/
minIdLength?: number;
/**
* Whether the SDK is connected to network.
*/
offline?: boolean | typeof OfflineDisabled;
/**
* The flag to opt this device out of Amplitude tracking.
* If this flag is set, no additional information will be stored for the user.
*/
optOut: boolean;
/**
* Tracking plan properties.
* Amplitude internal use.
*/
plan?: Plan;
/**
* Ingestion metadata.
* Amplitude internal use.
*/
ingestionMetadata?: IngestionMetadata;
/**
* The URL where events are upload to.
*/
serverUrl?: string;
/**
* The Amplitude server zone.
* Set this to EU for Amplitude projects created in EU data center.
*/
serverZone?: ServerZoneType;
/**
* The storage provider to persist unsent events.
*/
storageProvider?: Storage<Event[]>;
/**
* A customer Transport Class for sending data to a server.
*/
transportProvider: Transport;
/**
* The flag of whether to upload events to Batch API instead of the default HTTP V2 API.
*/
useBatch: boolean;

@@ -28,0 +84,0 @@ }

4

package.json
{
"name": "@amplitude/analytics-types",
"version": "2.5.0",
"version": "2.5.1",
"description": "",

@@ -38,3 +38,3 @@ "author": "Amplitude Inc",

],
"gitHead": "33fa1bd2b8e307a8a8d0a86610f8d893bf8aa5aa"
"gitHead": "5ec4220989f9b7972887d1ecb88b6b993f2bd8b1"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc