Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

sastaachar
Copy link

No description provided.


- **Node.js** (v16+ recommended)
- **pnpm / npm / yarn**

Copy link
Contributor

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

Copy link
Author

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'
Copy link
Contributor

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

Copy link
Author

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";
Copy link
Contributor

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.

Copy link
Author

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";
Copy link
Contributor

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.

Copy link
Author

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 ?

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.

@sastaachar sastaachar force-pushed the sastaachar/cookiless-embed branch from d735026 to 1899496 Compare March 4, 2025 10:02
{tsLogo ? <img src={tsLogo} alt="ThoughtSpot Logo" /> : null}
<span>Cookie-less App Embed</span>
</span>
{isInitialized ? <AppEmbed /> : null}
Copy link
Contributor

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);
}, []);
Copy link
Contributor

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:

  1. Make render wait for init.
  2. expose a new hook called useInit to encapsulate this usage.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants