npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

capacitor-amplitude

v3.0.2

Published

Amplitude plugin for capacitor

Readme

Capacitor amplitude plugin

Currently only works on ios, but android support will be coming soon

Available methods:

  • getInstance(instanceName: string): Amplitude - Retrieve an instance of the Amplitude class.
  • init(apiKey: string): Promise<void> - Initialize the Amplitude instance with a given API key.
  • logEvent(eventType: string, eventProperties?: Record<string, unknown>): Promise<void> - Log an event with the given type and optional properties.
  • enableCoppaControl(): Promise<void> - Enable COPPA (Children's Online Privacy Protection Act) restrictions.
  • disableCoppaControl(): Promise<void> - Disable COPPA restrictions.
  • regenerateDeviceId(): Promise<void> - Generate a new DeviceId.
  • setDeviceId(deviceId: string): Promise<void> - Manually set the DeviceId.
  • getDeviceId(): Promise<string> - Retrieve the current DeviceId.
  • useAdvertisingIdForDeviceId(): Promise<void> - Use the Advertising ID for the DeviceId.
  • setOptOut(optOut: boolean): Promise<void> - Enable or disable tracking opt-out.
  • trackingSessionEvents(trackingSessionEvents: boolean): Promise<void> - Enable or disable the automatic logging of session start and end events.
  • setUserId(userId: string | null): Promise<void> - Set the UserId.
  • setServerUrl(serverUrl: string): Promise<void> - Set the server URL for event uploads.
  • setUseDynamicConfig(useDynamicConfig: boolean): Promise<void> - Enable or disable dynamic server URL configuration.
  • logRevenue(userProperties: {...}): Promise<void> - Log revenue data with provided properties.
  • identify(identifyInstance: Identify): Promise<void> - Send user property operations to the Amplitude servers.
  • setGroup(groupType: string, groupName: string | string[]): Promise<void> - Add a user to a group or groups.
  • groupIdentify(groupType: string, groupName: string | string[], identifyInstance: Identify): Promise<void> - Update properties of particular groups.
  • setUserProperties(userProperties: Record<string, unknown>): Promise<void> - Set properties that are tracked at the user level.
  • clearUserProperties(): Promise<void> - Clear all properties that are tracked at the user level.
  • uploadEvents(): Promise<void> - Upload all unsent events to the server.
  • getSessionId(): Promise<number> - Retrieve the current session ID.
  • setMinTimeBetweenSessionsMillis(minTimeBetweenSessionsMillis: number): Promise<void> - Set the minimum time between sessions.
  • setServerZone(serverZone: string, updateServerUrl: boolean = true): Promise<void> - Set the server zone and optionally update the server URL.
  • setEventUploadMaxBatchSize(eventUploadMaxBatchSize: number): Promise<void> - Set the maximum number of events sent per upload request.
  • setEventUploadPeriodMillis(eventUploadPeriodMillis: number): Promise<void> - Sets the period in milliseconds for batch uploading unsent events.
  • setEventUploadThreshold(eventUploadThreshold: number): Promise<void> - Sets the threshold number of unsent events that will trigger a batch upload.
  • setPlan(plan: Plan): Promise<void> - Sets the tracking plan information.
  • setIngestionMetadata(ingestionMetadata: IngestionMetadata): Promise<void> - Sets the ingestion metadata information.

Usage example:

  1. In your module (e.g. app.module.ts)
...
import { Amplitude } from 'capacitor-amplitude'

@NgModule({
	...
	providers: [
		...
		{ provide: Amplitude, useFactory: () => Amplitude.getInstance() },
	],
})
export class AppModule {}
  1. In your component or service (e.g. analytics.service.ts)
...
import { Amplitude } from 'capacitor-amplitude'

@Injectable()
export class AnalyticsService {
	constructor(private amplitude: Amplitude) {}

	async init() {
		await this.amplitude.init('AMPLITUDE_API_KEY')
	}

	async logEvent(name: string, params?: Object) {
		await this.amplitude.logEvent(name, params)
	}

	async setUserId(id: string) {
		return this.amplitude.setUserId(id)
	}

	async getDeviceID(): string {
		return this.amplitude.getDeviceId()
	}

    async uploadEvents() {
        return this.amplitude.uploadEvents()
    }
}

BREAKING CHANGES in 2.x.x version

  • Added support for Capacitor 5

BREAKING CHANGES in 1.x.x version

  • Added full support for Capacitor 3 and removed compatibility with Capacitor 2