-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cookiless Embed example #3
base: main
Are you sure you want to change the base?
Conversation
|
||
- **Node.js** (v16+ recommended) | ||
- **pnpm / npm / yarn** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no codesandbox, please follow the template or use the npm run new-example
utility
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will update
@@ -0,0 +1,28 @@ | |||
import js from '@eslint/js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configure eslint globally for the repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do it
@@ -0,0 +1,124 @@ | |||
import { TextField, Typography, Button, Box, Paper } from "@mui/material"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again this tries to do a lot more than necessary. We should perhaps move this to starter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
@@ -0,0 +1,47 @@ | |||
import { ServerConfiguration, ThoughtSpotRestApi, createConfiguration } from "@thoughtspot/rest-api-sdk"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you have this on the client ? This will confuse people as they would then follow the pattern blindly.
Lets be supercareful of what we expose here. This is a backend API call and should be done as a separate node server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it , the reason i did here is to keep this example independent, without a token service this wont work, but what you said makes sense, so what do u suggest here instead ? how can i get a token here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sastaachar There is an example for spotter-agent-embed. Probably add a api layer which runs the token fetches.
d735026
to
1899496
Compare
{tsLogo ? <img src={tsLogo} alt="ThoughtSpot Logo" /> : null} | ||
<span>Cookie-less App Embed</span> | ||
</span> | ||
{isInitialized ? <AppEmbed /> : null} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace "null" with "Loading..."
thoughtSpotHost: THOUGHTSPOT_HOST, | ||
}); | ||
setIsInitialized(true); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets make the following 2 changes to the sdk:
- Make render wait for init.
- expose a new hook called
useInit
to encapsulate this usage.
No description provided.