Hey guys, quick question. I wanted to use SaaS hos...
# support-questions
j
Hey guys, quick question. I wanted to use SaaS hosted service for supertokens, but I also wanted to add a user to my own database as soon as they sign up to have that info on my side for other stuff. Is it possible?
r
Hey @Jota
Yes. That’s certainly possible
For the login method that you’d like to use, check out the post login operations section in the docs
And one of the pages in there will be about post sign up operations
j
I was able to do it! Thank you!
One more quick question How can I do these with require kind of import? import { SessionRequest } from 'supertokens-node/framework/express';
r
So that’s a type being imported. If you are using plain JS, then you don’t need to import that type and it’s only for TS
And if you are using ts, then you should be able to use import directly anyway
j
I can't import it
'SessionRequest' refers to a value, but is being used as a type here. Did you mean 'typeof SessionRequest'?ts(2749)
r
Can I see your code?
I think for types, you have to use import
j
I can't use import
r
Cause as soon as you use require, TS considers it as a value of type any
Then you can just remove it
Just do (req. res) => …
j
like this?
r
Yea.
j
req.session.touch() ^ TypeError: req.session.touch is not a function
r
Yea. I’m not sure where you got touch from. It’s not something we expose
j
How can i use res.send?
r
You can google that 🙂 nothing to do with supertokens
j
i think it is because I am using const session = require('express-session');
r
Right yea. So with supertokens, you don’t need to use express-session anymore
j
I think I got it!
Thank you so much ❤️
3 Views