How do I use payload-types.ts in my frontend?

default discord avatar
5 months ago

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:

Does this template make you run NextJS and Payload in a monorepo and one express server?

  • default discord avatar
    5 months ago

    Not sure if it is the


    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

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.