Consume a shared view - Amazon QuickSight

Consume a shared view

After you create a new shared view, use the Embedding SDK to make the shared view consumable for other users. The examples below set up a consumable shared view for an embedded dashboard in Amazon QuickSight.

With an appended URL

Append the sharedViewId to the embed URL, under /views/{viewId}, and expose this URL to your users. Users can use this URL to will navigate to that shared view.

const response = await dashboardFrame.createSharedView(); const newEmbedUrl = await generateNewEmbedUrl(); const formattedUrl = new URL(newEmbedUrl); formattedUrl.pathname = formattedUrl.pathname.concat('/views/' + response.message.sharedViewId); const baseUrl = formattedUrl.href; alert("Click to view this QuickSight shared view", baseUrl);
With the contentOptions SDK

Pass a viewId to the contentOptions to open the experience with the given viewId.

const contentOptions = { toolbarOptions: { ... }, viewId: sharedViewId, }; const embeddedDashboard = await embeddingContext.embedDashboard( {container: containerRef.current}, contentOptions );
With the InitialPath property
const shareView = async() => { const returnValue = await consoleFrame.createSharedView(); const {dashboardId, sharedViewId} = returnValue.message; const newEmbedUrl = await generateNewEmbedUrl(`/dashboards/${dashboardId}/views/${sharedViewId}`); setShareUrl(newEmbedUrl); }; const generateNewEmbedUrl = async (initialPath) => { const generateUrlPayload = { experienceConfiguration: { QuickSightConsole: { InitialPath: initialPath, FeatureConfigurations: { "SharedView": { "Enabled": true }, }, }, } const result: GenerateEmbedUrlResult = await generateEmbedUrlForRegisteredUser(generateUrlPayload); return result.url; };