happykit / flags

⛳️ Feature Flags for Next.js
https://happykit.dev
MIT License
1.01k stars 11 forks source link

How to retrieve flags in api of server not rendering pages #33

Closed mikeguo99 closed 1 year ago

mikeguo99 commented 1 year ago

I limit features in pages and meanwhile want to limit it in my api too. I'm not finding any function can be called in api. Only Public API can be used?

dferber90 commented 1 year ago

If your API is in Next.js (pages/api), you can use getFlags() just like you would in getServerSideProps. If your API is a separate service, you can use the Public API.

I'll close this but feel free to comment again if something is still unclear :)