I have a custom post type that has meta data which needs to be passed to my php code. I have the option to localize my script and use the data directly, or to call the rest-api and pull the information through ajax.
Which of these two is considered best practice/ which would you advise to use? Or should i use both (to authenticate the api call?) ?