Server Functions
Hello,
what is the best practice to initialize classes in server files with secret keys?
Can I just initialize them outside the server functions or should I always do it inside it?
Right now I'm doing it like so:
4 Replies
breakable-bronze•3mo ago
looks good
conscious-sapphireOP•3mo ago
aight thank you!
absent-sapphire•2mo ago
I would even go and abstract that into own serverOnlyFunction, for making 100% sure that GIPHY_API_KEY doesn't leark to client. Something like
conscious-sapphireOP•2mo ago
Oh I see, I thought createServerFn is already server only?