I have two separate projects:
- 1. a NextJS frontend project
- 2. a PayloadCMS project
Now, I want to consume my APIs from payload on my NextJS frontend. But I also want to query the API with type-safety. Do I just copy the types from
? What's the best way of going about this?
I also wish I knew about this template sooner:https://github.com/payloadcms/nextjs-custom-server
Does this template make you run NextJS and Payload in a monorepo and one express server?
Not sure if it is thebest
way, but copying
definitely works. Personally I like to include that step in my build process, that way I can't forget to update the types for a new deployment
Get help straight from the Payload team with an Enterprise License.