Skip to content

Commit d6ff3df

Browse files
committed
Merged PR 82436: [Embed JS] Add getCorrelationId
Add support for users to be able to get the correlation id [AKA session ID] for their embed session
1 parent d635633 commit d6ff3df

File tree

4 files changed

+55
-1
lines changed

4 files changed

+55
-1
lines changed

dist/powerbi-client.d.ts

+14
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,20 @@ declare module "embed" {
338338
* @returns {Promise<void>}
339339
*/
340340
saveAs(saveAsParameters: models.ISaveAsParameters): Promise<void>;
341+
/**
342+
* Get the correlationId for the current embed session.
343+
*
344+
* ```javascript
345+
* // Get the correlationId for the current embed session
346+
* report.getCorrelationId()
347+
* .then(correlationId => {
348+
* ...
349+
* });
350+
* ```
351+
*
352+
* @returns {Promise<string>}
353+
*/
354+
getCorrelationId(): Promise<string>;
341355
/**
342356
* Sends load configuration data.
343357
*

dist/powerbi.js

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/powerbi.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/embed.ts

+21
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,27 @@ export abstract class Embed {
312312
});
313313
}
314314

315+
/**
316+
* Get the correlationId for the current embed session.
317+
*
318+
* ```javascript
319+
* // Get the correlationId for the current embed session
320+
* report.getCorrelationId()
321+
* .then(correlationId => {
322+
* ...
323+
* });
324+
* ```
325+
*
326+
* @returns {Promise<string>}
327+
*/
328+
getCorrelationId(): Promise<string> {
329+
return this.service.hpm.get<string>(`/getCorrelationId`, { uid: this.config.uniqueId }, this.iframe.contentWindow)
330+
.then(response => response.body,
331+
response => {
332+
throw response.body;
333+
});
334+
}
335+
315336
/**
316337
* Sends load configuration data.
317338
*

0 commit comments

Comments
 (0)