Invisible content type field created by plugin

Hi! For my plugin, I want to add a “inivsible” field to every Entitiy of the content types. The field should only be visible in the API, not in the admin dashboard. This should happen before every creation and update of an entity. So far, I tried setting the event data in my plugins bootstrap.js like this

module.exports = {
  beforeCreate(event) {
    event.params.data.customField = "custom string"
  },
}

as described here but this is not working. Maybe because it is not in a lifecycle.js in the content type folder? I can’t find anything else about this in the docs. Any help is appreciated.

This topic has been created from a Discord post (1281296083875528900) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord