Quicksight Generative Q&A Embedding not working

I’ve generated the embedding url successfully, however when I try to use the embedding fact, it seems not to be working, I’m getting the event of frame loaded, but the iframe isn’t appearing

Following is my frontend (react) code and the print of it:

import { Button } from '@/web-design-system';
import { createEmbeddingContext } from 'amazon-quicksight-embedding-sdk';
import React, { useState } from 'react';
import { Container, Header } from './AIEmbed.styles';
import { getAiUrlQuicksightDashboard } from './services/AIEmbedService';

export const AIEmbed = () => {
  const [isLoading, setLoading] = useState(false);

  const fetchQS = async () => {
    try {
      setLoading(true);
      const dashboardUrls = await getAiUrlQuicksightDashboard();
      const embeddingContext = await createEmbeddingContext();
      const frameOptions: any = {
        url: dashboardUrls.data.content[0].url,
        container: '#embed-container',
        height: '1000px',
        width: '100%',
        onChange: (changeEvent: any, metadata: any) => {
          console.log('[FRAME]', JSON.stringify(changeEvent));
          console.log(metadata);
        },
      };
      const contentOptions: any = {
        panelOptions: {
          panelType: 'FULL',
          showQIcon: false,
        },
        showTopicName: false,
        allowTopicSelection: false,
        allowFullscreen: true,
        onMessage: (messageEvent: any, experienceMetadata: any) => {
          console.log('[CONTENT]', JSON.stringify(messageEvent));
          console.log(experienceMetadata);
        },
      };

      await embeddingContext.embedGenerativeQnA(frameOptions, contentOptions);
    } catch (error) {
      console.log(error);
    } finally {
      setLoading(false);
    }
  };

  return (
    <Container>
      <Header>
        <Button onClick={() => fetchQS()} width="150px" loading={isLoading}>
          Generate Q&A
        </Button>
      </Header>
      <div id="embed-container" />
    </Container>
  );
};

Am I doing something wrong?

Hi @wakeupmh

Quick check ..can you please ensure the webapplication domain is allowlisted in Quick Sight console as explained in the documentation in order to embedded Quick Sight Q & Dashboards.

Thanks
VInod

1 Like

Hey @apjvinod thanks for answering this question

I already have the domain in Quicksight’s allow list and an embedding working there. The problem only occurs with embedGenerativeQnA :confused:

Hello @wakeupmh and @apjvinod !

@wakeupmh were you able to find a solution for this or are you still working on this issue? My initial recommendation is to make sure that all of your permissions are correct for user/anonymous embedding because you were able to generate the iframe but no content appeared.

This topic will be archived in 3 business days because there has not been activity in the thread for some time.