I'm not sure about this but is there a

I'm not sure about this but is there a way which with I can use d1 with a wordpress website?
2 Replies
max
max14mo ago
I'm a complete newb on D1 and have never used wordpress, but I feel bad I buried your question with my massive one, so I thought I'd offer: It looks like D1 has an API you can hit directly from api.cloudflare.com. E.g., here's the docs to run a query: https://developers.cloudflare.com/api/operations/cloudflare-d1-query-database I think you need to provide an authorization header (top right of that page has a request sample), so I think you'd want to run this the word press server (with PHP) not on the client (with JS). That request sample has "cURL" and "guzzle" examples for PHP. GPT-4 tells me you could store your token in your wp-config.php wordpress config file, and that wordpress provides wp_remote_get() and wp_remote_post() functions that you could use to make the call. I hope this is helpful!
Cloudflare API Documentation
Interact with Cloudflare's products and services via the Cloudflare API
dhakkad
dhakkadOP14mo ago
Thanks a lot for providing insights, I'll give it a shot.
Want results from more Discord servers?
Add your server