JSPM

react-powerbi-client

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 32
  • Score
    100M100P100Q56063F
  • License MIT

A library which wraps the core powerbi-client library by providing components to easily embed within your react applications.

Package Exports

  • react-powerbi-client

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-powerbi-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-powerbi-client

Power BI for React JS which provides components and services to enabling developers to easily embed Power BI reports into their applications.

Getting started

Install

npm install --save react-powerbi-client

Include

import { Report } from 'react-powerbi-client';

Render component

<Report 
  id={this.state.embedConfig.id}
  embedUrl={this.state.embedConfig.embedUrl}
  accessToken={this.state.embedConfig.accessToken}
  filterPaneEnabled={true}
  navContentPaneEnabled={false}
  onEmbedded={this.onEmbedded}
/>

Example

import React, { Component } from 'react';
import { Report } from 'react-powerbi-client';

export default class extends Component {
  onEmbedded(embed) {
    console.log(`Report embedded: `, embed, this);
  }

  render() {
    return (
      <div>
        <h1>react-powerbi demo</h1>

        <Report
          id={this.state.embedConfig.id}
          embedUrl={this.state.embedConfig.embedUrl}
          accessToken={this.state.embedConfig.accessToken}
          filterPaneEnabled={true}
          navContentPaneEnabled={false}
          onEmbedded={this.onEmbedded}
        />
      </div>
    );
  }
}