Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

capacitor-amplitude

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capacitor-amplitude

Amplitude plugin for capacitor

  • 1.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Capacitor amplitude plugin

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

Available methods:

  • logEvent
  • setUserProfileID
  • reportUserProfile
  • getDeviceID

Usage example:

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

@NgModule({
	...
	providers: [
		...
		Amplitude,
	],
})
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 1.x.x version

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

Keywords

FAQs

Package last updated on 10 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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