MCPcopy Index your code
hub / github.com/amplitude/Amplitude-Node

github.com/amplitude/Amplitude-Node @v1.10.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.10.2 ↗ · + Follow
185 symbols 379 edges 61 files 38 documented · 21%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

npm version

Official Amplitude SDK for Node.js

This is Amplitude Node.js SDK written in Typescript, the 1st backend SDK for Amplitude. At this moment, we keep it minimal and simple because we want to give more thoughts over different customers' needs. Modularization and flexiblity will be the main priorities for this SDK. We would like to hear your ideas as well on how you plan on using this library!

Amplitude and Ampli SDK

Ampli SDK is autogenerated library based on your pre-defined tracking plan. The Ampli SDK, is a lightweight wrapper over the Amplitude SDK that provides type-safety, supports linting, and enables features like input validation. The code replicates the spec in the Tracking Plan and enforces its rules and requirements. This repository is about Amplitude SDK. To learn more about Ampli SDK, please refer to the Ampli Node and examples.

Installation and Quick Start

Please visit our :100:Developer Center for instructions on installing and using our the SDK.

Check Out the Sub-Packages

In order of what might be good to read to get acquainted with the Node SDK:

  • (@amplitude/node): The core Node SDK and a starting place for logging events in Node.js.
  • (@amplitude/types): Contains our helper types and enums(What an event looks like, what to expect the response to look like). A resource for interfacing with the Node SDK.
  • (@amplitude/identify): A builder-type class that helps interface with the Identify API and the Node SDK. Use it to compose Identify events for both users and groups.
  • (@amplitude/identity): A helper class to store the "identity" (device + user ID) of a certain event or client.
  • (@amplitude/utils): A list of shared (mostly) polymorphic utilities across our javascript-based SDK's.
  • ("@amplitude/eslint-config-typescript`): The ESLint configuration shared across our repositories.

Need Help?

If you have any problems or issues over our SDK, feel free to create a github issue or submit a request on Amplitude Help.

Extension points exported contracts — how you extend this code

Transport (Interface)
(no doc) [4 implementers]
packages/types/src/transport.ts
Global (Interface)
(no doc)
packages/utils/test/misc.test.ts
RetryMetadata (Interface)
(no doc)
packages/node/src/retry/defaultRetry.ts
Retry (Interface)
(no doc) [4 implementers]
packages/types/src/retry.ts
Array (Interface)
(no doc)
packages/utils/test/misc.test.ts
HTTPRequest (Interface)
(no doc)
packages/node/src/transports/http.ts
Identity (Interface)
(no doc) [2 implementers]
packages/types/src/identity.ts
QueueObject (Interface)
(no doc)
packages/utils/src/queue.ts

Core symbols most depended-on inside this repo

warn
called by 23
packages/utils/src/logger.ts
identifyUser
called by 19
packages/identify/src/identify.ts
set
called by 12
packages/identify/src/identify.ts
sendEventsWithRetry
called by 11
packages/types/src/retry.ts
sendPayload
called by 10
packages/types/src/transport.ts
_safeSet
called by 10
packages/identify/src/identify.ts
getDeviceId
called by 9
packages/types/src/identity.ts
isValidEvent
called by 9
packages/utils/src/validate.ts

Shape

Method 93
Class 32
Function 28
Interface 28
Enum 4

Languages

TypeScript100%

Modules by API surface

packages/identify/src/identify.ts20 symbols
packages/node/src/retry/defaultRetry.ts14 symbols
packages/node/src/nodeClient.ts12 symbols
packages/node/src/transports/http.ts10 symbols
packages/identity/src/identity.ts9 symbols
packages/utils/src/misc.ts8 symbols
packages/utils/src/logger.ts8 symbols
packages/node/test/mocks/transport.ts8 symbols
packages/types/src/identity.ts7 symbols
packages/node/src/retry/offlineRetry.ts7 symbols
packages/utils/src/queue.ts6 symbols
packages/node/src/retry/baseRetry.ts6 symbols

For agents

$ claude mcp add Amplitude-Node \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page