JSPM

@amplitude/sdk-adapter

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q41030F
  • License MIT

Amplitude SDK Wrapper Tool

Package Exports

  • @amplitude/sdk-adapter
  • @amplitude/sdk-adapter/lib/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@amplitude/sdk-adapter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme


Amplitude Browser SDK Adapter Tool

Amplitude's tool to ease engineering cost of migrating SDK libraries. Currently supported only for the browser SDK. Segment's analytics SDK API can be kept and analytics actions will be forwarded to Amplitude. Currently support track and identify calls.

Usage

1. Install

npm install 

2. Import packages

import { AnalyticsAdapter } from "sdk-adapter";
import { AnalyticsBrowser } from "@segment/analytics-next";
import { createInstance } from "@amplitude/analytics-browser";

3. Create instances of Amplitude and Segment SDKs

const amplitude = createInstance();
amplitude.init(AMPLITUDE_API_KEY);

const segment = new AnalyticsBrowser();
segment.load({ writeKey: SEGMENT_WRITE_KEY });

4. Create adapter instance and replace Segment APIs with supported adapter APIs

const analytics = new AnalyticsAdapter(segment, amplitude);
analytics.track('test event')