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
lelek00322 years ago
2

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
    2 years ago

    Hey

    @1085968471193567362

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

  • default discord avatar
    lelek00322 years ago

    Yep, thanks!

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.