You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merged PR 320270: Add support of registering external components to SDK
Add support of registering external components to SDK
How does it work?
1. User creates a new embed component extending `Embed` in his project
2. User implements the necessary code in FE to support hosting of the new component and handling events
3. Needed code to embed the new component:
`powerbi.register(componentType, embedComponentFactory, routerEventUrls);`
`powerbi.embed(embedContainer, config);`
powerbi.register:
- `componentType`: string representing the component type in embed configuration interface
- `embedComponentFactory`: function that returns a new instance of the embed component.
- `routerEventUrls`: list of urls to register, must use uniqueId and eventName as keys. something like that: `/componentName/:uniqueId/events/:eventName`
Example of calling powerbi.register for metric-picker component:
```
this.register(
'metric_picker',
(service, element, config, phasedRender, isBootstrap) => new MetricPicker(service, element, config, phasedRender, isBootstrap),
['/metricPicker/:uniqueId/events/:eventName']
);
```
0 commit comments