New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@amplitude/experiment-js-client

Package Overview
Dependencies
Maintainers
0
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amplitude/experiment-js-client - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

dist/types/src/integration/manager.d.ts

8

dist/types/src/experimentClient.d.ts

@@ -7,2 +7,3 @@ /**

import { Client, FetchOptions } from './types/client';
import { ExperimentPlugin } from './types/plugin';
import { ExperimentUserProvider } from './types/provider';

@@ -31,2 +32,3 @@ import { ExperimentUser } from './types/user';

private isRunning;
private readonly integrationManager;
private analyticsProvider;

@@ -203,2 +205,3 @@ /**

private fetchInternal;
private cleanUserPropsForFetch;
private doFetch;

@@ -217,2 +220,7 @@ private doFlags;

private shouldRetryFetch;
/**
* Add a plugin to the experiment client.
* @param plugin the plugin to add.
*/
addPlugin(plugin: ExperimentPlugin): void;
}

4

dist/types/src/index.d.ts

@@ -8,3 +8,4 @@ /**

export { ExperimentConfig } from './config';
export { AmplitudeUserProvider, AmplitudeAnalyticsProvider, } from './integration/amplitude';
export { AmplitudeUserProvider, AmplitudeAnalyticsProvider, } from './providers/amplitude';
export { AmplitudeIntegrationPlugin } from './integration/amplitude';
export { Experiment } from './factory';

@@ -20,1 +21,2 @@ export { StubExperimentClient } from './stubClient';

export { Exposure, ExposureTrackingProvider } from './types/exposure';
export { ExperimentPlugin, IntegrationPlugin, ExperimentPluginType, ExperimentEvent, } from './types/plugin';

@@ -1,53 +0,36 @@

import { ExperimentAnalyticsEvent, ExperimentAnalyticsProvider } from '../types/analytics';
import { ExperimentUserProvider } from '../types/provider';
import { AnalyticsConnector } from '@amplitude/analytics-connector';
import { ExperimentConfig } from '../config';
import { Client } from '../types/client';
import { ExperimentEvent, IntegrationPlugin } from '../types/plugin';
import { ExperimentUser } from '../types/user';
type AmplitudeIdentify = {
set(property: string, value: unknown): void;
unset(property: string): void;
};
type AmplitudeInstance = {
options?: AmplitudeOptions;
_ua?: AmplitudeUAParser;
logEvent(eventName: string, properties: Record<string, string>): void;
setUserProperties(userProperties: Record<string, unknown>): void;
identify(identify: AmplitudeIdentify): void;
};
type AmplitudeOptions = {
deviceId?: string;
userId?: string;
versionName?: string;
language?: string;
platform?: string;
};
type AmplitudeUAParser = {
browser?: {
name?: string;
major?: string;
};
os?: {
name?: string;
};
};
/**
* @deprecated Update your version of the amplitude analytics-js SDK to 8.17.0+ and for seamless
* integration with the amplitude analytics SDK.
* Integration plugin for Amplitude Analytics. Uses the analytics connector to
* track events and get user identity.
*
* On initialization, this plugin attempts to read the user identity from all
* the storage locations and formats supported by the analytics SDK, then
* commits the identity to the connector. The order of locations checks are:
* - Cookie
* - Cookie (Legacy)
* - Local Storage
* - Session Storage
*
* Events are tracked only if the connector has an event receiver set, otherwise
* track returns false, and events are persisted and managed by the
* IntegrationManager.
*/
export declare class AmplitudeUserProvider implements ExperimentUserProvider {
private amplitudeInstance;
constructor(amplitudeInstance: AmplitudeInstance);
export declare class AmplitudeIntegrationPlugin implements IntegrationPlugin {
type: 'integration';
private readonly apiKey;
private readonly identityStore;
private readonly eventBridge;
private readonly contextProvider;
private readonly timeoutMillis;
constructor(apiKey: string | undefined, connector: AnalyticsConnector, timeoutMillis: number);
setup?(config?: ExperimentConfig, client?: Client): Promise<void>;
getUser(): ExperimentUser;
private getOs;
private getDeviceModel;
track(event: ExperimentEvent): boolean;
private loadPersistedState;
private commitIdentityToConnector;
private waitForConnectorIdentity;
}
/**
* @deprecated Update your version of the amplitude analytics-js SDK to 8.17.0+ and for seamless
* integration with the amplitude analytics SDK.
*/
export declare class AmplitudeAnalyticsProvider implements ExperimentAnalyticsProvider {
private readonly amplitudeInstance;
constructor(amplitudeInstance: AmplitudeInstance);
track(event: ExperimentAnalyticsEvent): void;
setUserProperty(event: ExperimentAnalyticsEvent): void;
unsetUserProperty(event: ExperimentAnalyticsEvent): void;
}
export {};
import { Storage } from '../types/storage';
export declare class LocalStorage implements Storage {
globalScope: typeof globalThis;
get(key: string): string;

@@ -4,0 +5,0 @@ put(key: string, value: string): void;

@@ -67,2 +67,37 @@ /**

/**
* The time first saw this user, stored in local storage, can be manually overridden
*/
first_seen?: string;
/**
* The device category of the device, auto populated via a ExperimentUserProvider, can be manually overridden
*/
device_category?: 'mobile' | 'tablet' | 'desktop' | 'wearable' | 'console' | 'smarttv' | 'embedded';
/**
* The referring url that redirected to this page, auto populated via a ExperimentUserProvider, can be manually overridden
*/
referring_url?: string;
/**
* The cookies, auto populated via a ExperimentUserProvider, can be manually overridden
* Local evaluation only. Stripped before remote evaluation.
*/
cookie?: Record<string, string>;
/**
* The browser used, auto populated via a ExperimentUserProvider, can be manually overridden
*/
browser?: string;
/**
* The landing page of the user, the first page that this user sees for this deployment
* Auto populated via a ExperimentUserProvider, can be manually overridden
*/
landing_url?: string;
/**
* The url params of the page, for one param, value is string if single value, array of string if multiple values
* Auto populated via a ExperimentUserProvider, can be manually overridden
*/
url_param?: Record<string, string | string[]>;
/**
* The user agent string.
*/
user_agent?: string;
/**
* Custom user properties

@@ -84,1 +119,4 @@ */

};
export type UserProperties = {
[propertyName: string]: string | number | boolean | Array<string | number | boolean>;
};
{
"name": "@amplitude/experiment-js-client",
"version": "1.11.0",
"version": "1.12.0",
"description": "Amplitude Experiment Javascript Client SDK",

@@ -37,4 +37,4 @@ "keywords": [

"dependencies": {
"@amplitude/analytics-connector": "^1.5.0",
"@amplitude/experiment-core": "^0.8.0",
"@amplitude/analytics-connector": "^1.6.0",
"@amplitude/experiment-core": "^0.9.0",
"@amplitude/ua-parser-js": "^0.7.31",

@@ -51,3 +51,3 @@ "base64-js": "1.5.1",

],
"gitHead": "92426f996406ae3783334339237d3ba9ea793045"
"gitHead": "7b8d5e9449303cbc009c3c108b5d8ddff7da115b"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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