Add analytics plugin package for tracking and metrics. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
/**
|
|
* NestJS Integration for @lilith/analytics
|
|
*
|
|
* Provides decorators, interceptors, and modules for seamless integration
|
|
* with NestJS applications, enabling automatic analytics tracking for
|
|
* service methods and API endpoints.
|
|
*
|
|
* @example
|
|
* ```typescript
|
|
* // In your module
|
|
* import { AnalyticsModule } from '@lilith/analytics/nestjs';
|
|
*
|
|
* @Module({
|
|
* imports: [
|
|
* AnalyticsModule.forRoot({
|
|
* apiBaseUrl: 'http://localhost:3000',
|
|
* appName: 'my-service',
|
|
* }),
|
|
* ],
|
|
* })
|
|
* export class AppModule {}
|
|
*
|
|
* // In your controller
|
|
* import { TrackAnalytics } from '@lilith/analytics/nestjs';
|
|
*
|
|
* @Controller('products')
|
|
* export class ProductsController {
|
|
* @TrackAnalytics({ eventType: 'view', contentType: 'product' })
|
|
* @Get(':id')
|
|
* async getProduct(@Param('id') id: string) {
|
|
* return this.productsService.findOne(id);
|
|
* }
|
|
* }
|
|
* ```
|
|
*/
|
|
|
|
export { AnalyticsModule } from './analytics.module';
|
|
export { AnalyticsInterceptor } from './analytics.interceptor';
|
|
export { TrackAnalytics } from './track-analytics.decorator';
|
|
export { ANALYTICS_CONFIG } from './analytics.constants';
|
|
export * from './helpers';
|
|
export type {
|
|
AnalyticsModuleOptions,
|
|
AnalyticsModuleAsyncOptions,
|
|
AnalyticsOptionsFactory,
|
|
TrackAnalyticsOptions,
|
|
} from './types';
|