Reusing Server Actions for API access

Hi all,

Just wondering if this use case has been discussed before.

I’ve just finished working on the user model for a new project (user signup, login, etc). I’m using server actions for the server logic.

I’m also working on an iOS app that will have feature parity with the website.

I’m wondering whether there’s a smart way to reuse the server actions so the app can request them as well.

I understand that server actions do create publicly accessible endpoints that are similar to API routes, but I’m wondering if there are any considerations I should have before calling them.

I suppose I could move the server action logic into helper/util functions that can be shared between the server actions and various /api/signup and /api/login routes.

Just wondering about best practices.

Thanks