JS SDK vs PHP SDK

From my brief study of various websites, it seems that the JS SDK is much more commonly used than the PHP SDK. Even sites implemented in PHP use the JS SDK. The PHP link page has 776 likes, while the JS man page has 20k + likes. The PHP link page says that the PHP SDK helps you add the Facebook login to your page, but even the login button uses the JS SDK. Does the PHP SDK really have any advantage? Why is so little effort put into the PHP SDK?

+5
source share
2 answers

Well, the JS SDK will be more popular. Not everyone develops their server-side code in PHP (can use Java / Scala /. NET / Python / etc, etc.), but everyone needs to write their client-side code in JavaScript.

As for the benefits of both, you can certainly use the JavaScript SDK.

  • Less load on your server.
  • The best response time, because the request comes directly from the client’s browser on Facebook, and not from the browser => your server => Facebook and vice versa.

Of course, there are times when you have to do something on the server side, either because you want to save the result in your database, or in your security-vulnerable operation. (for example, you will never pass your access_token application to the client and will not use it from there as its secret).

PHP SDK , , HTTP , GET Json/XML, signed_request POST , SDK . ( , ). , SDK JavaScript, , , FB, , Iframe. , SDK .

+9

PHP SDK API Facebook.

JS SDK , Node.js .

, Facebook: .

+1

All Articles