Hello,
I found that when I add a custom component like this inside a collection:
...
fields: [
{
name: "approveButton",
label: " ",
type: "ui",
admin: {
components: {
Field: ApproveButtonComponent,
}
}
},
]
...
inside the "ApproveButtonComponent" environment variables are not available.
Is there a way to share environment variables to custom components like this?
Thanks in advance for your help!
are you using 2.0 or 3.0?
if 2.0 public envs that should be accessible from the front end need to start with the prefix PAYLOAD_PUBLIC like PAYLOAD_PUBLIC_URL
3.0 - the same but NEXT_PUBLIC.
Thank you so much @r1tsuu ! This worked like a charm :)
Star
Discord
online
Get dedicated engineering support directly from the Payload team.