Api call in custom block
-
Hi,
I am new to wordpress development and exploring custom block development to create a custom block for my website.
The block I am planning to create has to call an external api to get some data. This data will be displayed in the block markup.
I have a few questions.
I think I can call the extenal api in the frontend via javascript and in the server via php. The javascript part is clear but I am confused how do I call the api on the server via php. Is there an example I can explore?
Secondly, the block will not have access to the options so where do I store the api key?
Please point me to the relevant resources if they exist.
Thanks
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Api call in custom block’ is closed to new replies.