A TypeScript-based analytics tracking package with automatic configuration for web applications. This package provides an easy way to track and analyze user interactions in your applications.
- Easy application registration through CLI
- Automatic API key generation
- MongoDB integration for data storage
- TypeScript support
- Simple tracking initialization
npm install analytics-tracker-package
# or
yarn add analytics-tracker-package
# or
pnpm add analytics-tracker-package
After installation, the package will automatically run the setup process. If you need to run it manually, you can use:
npm run setup
# or
yarn setup
# or
pnpm setup
During setup, you'll be prompted to:
- Enter your application name
- The system will automatically generate an API key for your application
After completing the setup, you can start using the tracker in your application:
import { Tracker } from 'analytics-tracker-package';
const tracker = new Tracker({
apiKey: 'your-api-key',
appName: 'your-app-name'
});
await tracker.initialize();
interface TrackingConfig {
apiKey: string; // Your application's API key
appName: string; // Your application name
endpoint?: string; // Optional custom endpoint
}
interface AppRegistration {
appName: string; // Application name
apiKey: string; // Generated API key
endpoint: string; // API endpoint
createdAt: Date; // Registration date
active: boolean; // Application status
}
interface TrackingEvent {
type: string; // Event type
timestamp: number; // Event timestamp
data: Record<string, any>; // Event data
}
- Node.js (v14 or higher)
- npm, yarn, or pnpm
- MongoDB database
npm run build
npm run test
npm run lint
MIT
Auratech Team