Registry / azure / powerbi-client-angular

powerbi-client-angular

JSON →
library6.0.3jsnpmunverified

Angular wrapper library for embedding Power BI reports, dashboards, tiles, visuals, Q&A, paginated reports, and creating reports directly in Angular applications. Current stable version is 6.0.3, released under MIT license. Maintained by Microsoft, with active development and regular releases aligned with Angular versions. Key differentiators: provides Angular-native components (e.g., powerbi-report, powerbi-dashboard) with property binding and event handling, supports phased embedding for performance optimization, and integrates with powerbi-client and powerbi-report-authoring libraries. Requires Angular 17+ and RxJS.

npm install powerbi-client-angular
INSTALL
IMPORT
SIG · POWERBI-CLIENT-ANG
P
powerbi-client-angular
azurejavascriptv6.0.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PowerBIEmbedModule
import { PowerBIEmbedModule } from 'powerbi-client-angular';
Must be imported in the Angular module (NgModule) where embedding components are used.
PowerBIReportEmbedComponent
import { PowerBIReportEmbedComponent } from 'powerbi-client-angular';
import { PowerBIReportEmbedComponent } from 'powerbi-client-angular/powerbi-report-embed.component';
Component is re-exported from the module; direct import from subpath is not supported.
PowerBIEmbed
import { PowerBIEmbed } from 'powerbi-client-angular';
import PowerBIEmbed from 'powerbi-client-angular';
PowerBIEmbed is a named export (decorator), not a default export. Used for custom components with @PowerBIEmbed().
models
import { models } from 'powerbi-client-angular';
import { models } from 'powerbi-client';
models is re-exported from powerbi-client for convenience, but importing directly from powerbi-client also works.

Imports PowerBIEmbedModule, defines a component with powerbi-report selector, configures embed properties and event handlers.

// app.module.ts import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { PowerBIEmbedModule } from 'powerbi-client-angular'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule, PowerBIEmbedModule ], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } // app.component.ts import { Component } from '@angular/core'; import { models } from 'powerbi-client-angular'; @Component({ selector: 'app-root', template: ` <powerbi-report [embedConfig]="{ type: 'report', id: 'reportId', embedUrl: 'https://app.powerbi.com/reportEmbed?reportId=reportId', accessToken: accessToken, tokenType: models.TokenType.Embed }" [cssClassName]="'report-class'" [eventHandlers]="eventHandlers" ></powerbi-report> ` }) export class AppComponent { accessToken = 'YOUR_ACCESS_TOKEN'; eventHandlers = new Map<string, (event?: any) => void>([ ['loaded', () => console.log('Report loaded')], ['rendered', () => console.log('Report rendered')], ['error', (event) => console.log(event.detail)] ]); }
Debug
Known issues
breakingUpgraded to Angular 17 and powerbi-client 2.23.1 as of v5.0.0. Older Angular versions are not supported.
fix
Update Angular to 17+ and powerbi-client to 2.23.1+.
affects: <5.0.0
breakingIn v4.0.0, the paginated report component interface was updated. Existing code using paginated reports may break.
fix
Update paginated report configuration to match new interface as per documentation.
affects: >=3.0.0 <4.0.0
deprecatedPowerBIEmbedModule is still used, but Angular standalone components are becoming the norm. The library may transition away from NgModules in future versions.
fix
Watch for future releases that may support standalone components.
affects: >=5.0.0
gotchaThe component re-embeds on every configuration change. Ensure embedConfig is immutable or use OnPush change detection to avoid unnecessary re-embeds.
fix
Use immutable objects for embedConfig or implement ChangeDetectionStrategy.OnPush.
affects: >=5.0.0
Errors
Common errors & fixes
Error: Cannot find module 'powerbi-client-angular'
Package not installed or incorrect import path.
fix
Run 'npm install powerbi-client-angular powerbi-client' and ensure import path is 'powerbi-client-angular'.
TypeError: Cannot read properties of undefined (reading 'Embed')
models not imported correctly or accessToken missing.
fix
Import models from 'powerbi-client-angular' and ensure embedConfig includes a valid accessToken.
NG8001: 'powerbi-report' is not a known element
PowerBIEmbedModule not imported in the module that declares the component.
fix
Add PowerBIEmbedModule to the imports array of the NgModule.
Upgrade
Version history
6.0.3latest on npm
Audit
Dependencies
powerbi-clientrequiredCore library for Power BI embedding functionality
powerbi-report-authoringoptionalOptional dependency for report authoring features (changing visual types, etc.)
rxjsrequiredPeer dependency for Angular reactive programming
Agent activity
26 hits · last 30 days
node
22
OpenAI (training)
1
Resources
powerbi-client-angular — npm install powerbi-client-angular · libregistry