Accessing buildConfig.custom

default discord avatar
Lelek
6 months ago
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
    Payload Team
    6 months ago

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

  • default discord avatar
    Lelek
    6 months ago

    Yep, thanks!

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

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

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