Next.js Discord

Discord Forum

Deploy Server Actions on different Domain

Unanswered
Catla posted this in #help-forum
Open in Discord
CatlaOP
Hi,
I’m building a realtime e-commerce fulfillment app with multi tenancy and realtime collaboration. It started out as a nextjs 14/15 project and I highly appreciate the value of server actions for integrating a variety of external APIs and protocols in a fast and type safe way.

But since it’s essential that only a single tab or browser session (or even better a single app instance per machine) is actively running per user, I meanwhile consider wrapping my app inside of tauri (also due to extended platform capabilities).

I could change my nextjs project to statically export all sites for the final app. But how could I continue to use server actions when I “deploy” my frontend inside of tauri? Would it be possible to deploy the app with the actions on vercel and use them from both the app (as a website) as well as from the tauri app where I run the static exports as SPA ?

I saw that we can add origins that are permitted to execute server actions.

Would be great if someone could share their advise or ideas! Thanks a lot

1 Reply

Server actions are basically API endpoints, so if you want to use them from different domains you should convert them into normal api's.