JSFiddle - React, Tailwind, and code Playground
by Sinh Nguyen
HTML
<!DOCTYPE html>
<html>
<head>
<title>Basic Embed</title>
<!-- You can download the latest QuickSight embedding SDK version from https://www.npmjs.com/package/amazon-quicksight-embedding-sdk -->
<!-- Or you can do "npm install amazon-quicksight-embedding-sdk", if you use npm for javascript dependencies -->
<script src="https://unpkg.com/[email protected]/dist/quicksight-embedding-js-sdk.min.js"></script>
<script type="text/javascript">
function embedDashboard() {
var containerDiv = document.getElementById("embeddingContainer");
fetch('https://1qus1jpqu1.execute-api.ap-southeast-1.amazonaws.com/prod/api/dashboard/', {
method: 'GET'
}).then(function(response) { return response.json(); })
.then(function(json) {
var options = {
// replace this dummy url with the one generated via embedding API
url: json.url,
container: containerDiv,
scrolling: "no",
height: "700px",
width: "1000px",
footerPaddingEnabled: true
} ;
dashboard = QuickSightEmbedding.embedDashboard(options);
})
.then((data) => {
console.log(data);
});
}
</script>
</head>
<body onload="embedDashboard()">
<div id="embeddingContainer"></div>
</body>
</html>