Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Hey @Aditya Thanks for the reply. Here - ThoughtSpot For Developers
TFD
ThoughtSpot For Developers
•
2y ago
•
1 reply
Chavda Jitendra
Hey @Aditya Thanks for the reply. Here
Hey
@Aditya Thanks for the reply
. Here is the code snippet I am using to generate my JWT Token
const express
= require
(
'express
'
)
;
const jwt
= require
(
'jsonwebtoken
'
)
;
const dotenv
= require
(
'dotenv
'
)
;
const cors
= require
(
'cors
'
)
;
const bodyParser
= require
(
'body
-parser
'
)
;
dotenv
.config
(
)
;
const app
= express
(
)
;
const PORT
= process
.env
.PORT
5000
;
const corsOptions
=
{
origin
:
'
https://ts-embed.bubbleapps.io
'
,
optionsSuccessStatus
: 200
,
}
;
app
.use
(cors
(corsOptions
)
)
;
app
.use
(bodyParser
.json
(
)
)
;
app
.post
(
'
/generateToken
'
,
(req
, res
)
=
>
{
const
{ userId
, userName
, email
}
= req
.body
;
if
(
!userId
!userName
|
|
!email
)
{
return res
.status
(400
)
.json
(
{ error
:
'Missing required user information
.
'
}
)
;
}
const payload
=
{
sub
: userId
,
name
: userName
,
email
: email
,
iat
: Math
.floor
(Date
.now
(
)
/ 1000
)
,
exp
: Math
.floor
(Date
.now
(
)
/ 1000
)
+
(60
* 60
)
,
/
/ Token valid for 1 hour
}
;
const token
= jwt
.sign
(payload
, process
.env
.THOUGHTSPOT
_SECRET
)
;
res
.json
(
{ token
}
)
;
}
)
;
app
.listen
(PORT
,
(
)
=
>
{
console
.log
(
Token service is running on port ${PORT}
Token service is running on port ${PORT}
)
;
}
)
;
ThoughtSpot For Developers
Join
883
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
@shikharTS @Aditya
TFD
ThoughtSpot For Developers / dev-help
2y ago
animesh - @Justin Mathew @Aditya like the way...
TFD
ThoughtSpot For Developers / dev-help
6mo ago
Neerav - Hey guys, here's the recording of the ...
TFD
ThoughtSpot For Developers / dev-help
11mo ago
Suvash - Hey team, for the ConversationEmbed, i...
TFD
ThoughtSpot For Developers / dev-help
11mo ago