Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Accessing buildConfig.custom

default discord avatar
Leleklast year
4

I want to use the payload config to configure stuff. How can I access the 'custom' prop of the builConfig within my plugins?



https://payloadcms.com/docs/configuration/overview#the-payload-config


e.g. I want to set a custom bool in my buildConfig:



custom: {


mediaDatePrefix: false,


},



and read that config within my plugin. Is that possible?



if ((await payloadConfig).custom.mediaDatePrefix) {


}



figured it out!

  • discord user avatar
    patrikkozak
    last year

    Hey @Lelek, just double checking here - you were able to find a solution?

  • default discord avatar
    Leleklast year

    Yep, thanks!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

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