Integrate Bugster SDK with Angular

This guide will help you integrate Bugster SDK into your Angular project and start using its automated testing capabilities.


Prerequisites

Before getting started, ensure you have:

  • An Angular project set up (version 9.0 or later)
  • Node.js and npm installed
  • A Bugster account with an API key

Step 1: Install the Bugster SDK

Install Bugster SDK using your package manager:

npm i @bugster/bugster-js

Step 2: Add Environment Variables

Add your environment variables to your .env.local file and your hosting provider (such as Vercel, Netlify, AWS). You can find your project API key in your project settings.

BUGSTER_KEY=YOUR_API_KEY

Step 3: Initialize Bugster SDK

// src/main.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { BugsterTracker } from '@bugster/bugster-js';

// Initialize BugsterTracker before starting the application
const bugster = new BugsterTracker({
  apiKey: process.env.BUGSTER_KEY,
  endpoint: "https://i.bugster.app",
});

// Start the application by loading the main module
platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));

Conclusion

You’ve now successfully integrated Bugster SDK into your Angular application. This integration allows you to capture user interactions, generate automated tests, and improve the overall quality of your Angular app.

For more advanced usage and configuration options, refer to the Bugster SDK API Reference and the Advanced Configuration Guide.

If you encounter any issues or have questions, don’t hesitate to contact our support team.