FlatFilers / flatfile-nextjs

1 stars 1 forks source link

Hosting this on a static site #13

Open dvasdekis opened 3 weeks ago

dvasdekis commented 3 weeks ago

Hi team,

We build our Next.js sites to be served on a static site engine (Azure Static Web Apps) and we're wondering if this will work within that environment. Having to embed the secret key on the server code does create some concerns for us. Thanks!

bangarang commented 1 week ago

Hey @dvasdekis!

We have an example flow of generating the Client Side token on the Nextjs backend here: https://github.com/FlatFilers/flatfile-nextjs/blob/main/pages/api/spaces/%5Bid%5D.ts

This way the Secret Key is safely stored Server Side and not exposed client side.

This is pretty specific to Next.js so I'm curious on your static site setup and how this could work there - do you have a backend that you can use for this generation or is your whole site generated client side?

Arsik36 commented 1 week ago
Thanks for reaching out! 

Flatfile is having a company offsite this week, October 7-11. We'll be a bit slower to reply but are still here to support you! 

Best, 
Flatfile Support