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.
npm install
import { AnalyticsAdapter } from "sdk-adapter";
import { AnalyticsBrowser } from "@segment/analytics-next";
import { createInstance } from "@amplitude/analytics-browser";
const amplitude = createInstance();
amplitude.init(AMPLITUDE_API_KEY);
const segment = new AnalyticsBrowser();
segment.load({ writeKey: SEGMENT_WRITE_KEY });
const analytics = new AnalyticsAdapter(segment, amplitude);
analytics.track('test event')