User fields empty for addPosterIcons when creating new post

I am currently adding user social accounts in custom fields. Using plugin api’s addPosterIcons function to render the social accounts in front of username but the user custom fields are empty for a newly created post. What am I doing wrong here?


function initializeDiscourseUserProfileEnhancer(api) {
  api.addPosterIcons((cfs, attrs) => {
    // cfs and attrs.userCustomFields objects are empty for new post

export default {
  name: "discourse-user-profile-enhancer",

  initialize() {
    withPluginApi("0.8.31", initializeDiscourseUserProfileEnhancer);