@journium/angular
v1.0.4
Published
Journium Angular integration - Service, module, and providers for Angular applications
Readme
@journium/angular
The official Journium SDK for Angular. Track events, pageviews, and user interactions using Angular's dependency injection with service and provider APIs.
Getting Started
Learn how to use Journium in your Angular application:
Prerequisites
- Angular 15.0.0 or later (see Angular Version Compatibility)
- Node.js
>=20.9.0or later - An existing Journium application. Create your account for free.
Installation
npm install @journium/angularUsage
Standalone API (modern Angular, recommended):
// main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { provideJournium, withJourniumRouter } from '@journium/angular';
import { provideRouter } from '@angular/router';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent, {
providers: [
provideRouter(routes),
provideJournium({
publishableKey: 'your-publishable-key'
}),
withJourniumRouter(), // optional — auto-tracks pageviews on navigation
]
});NgModule API (legacy):
// app.module.ts
import { NgModule } from '@angular/core';
import { JourniumModule } from '@journium/angular/ngmodule';
@NgModule({
imports: [
JourniumModule.forRoot({
publishableKey: 'your-publishable-key'
})
]
})
export class AppModule {}Injecting the service in any component:
// any.component.ts
import { Component } from '@angular/core';
import { JourniumService } from '@journium/angular';
@Component({ ... })
export class MyComponent {
constructor(private journium: JourniumService) {}
onButtonClick() {
this.journium.track('button_click', { button: 'signup' });
}
}For more detailed examples and configuration options, visit the Journium documentation.
Other SDKs
- @journium/react - React SDK
- @journium/nextjs - Next.js SDK
- @journium/js - JavaScript SDK
Support
Need help? Reach out to us:
- 📖 Join our official community Discord server
- 🐛 Issue Tracker
Contributing
We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines and code of conduct.
License
This project is licensed under the MIT license.
See LICENSE for more information.
