Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Javascript vs PHP SDK

Tags:

javascript

php

I am somewhat confused by the facebook developers guide. Some tutorials show the javascript SDK being used while some show the PHP SDK being used. Do I need to load both of these? Are there any differences between the two (besides one being client and one being server)?

I am wanting to use Facebook's SDK for User Authentication, Social Plugins, and the Graph API.

like image 588
Chris Abrams Avatar asked Mar 22 '11 20:03

Chris Abrams


People also ask

What is Facebook JavaScript SDK?

The Facebook SDK for JavaScript provides a rich set of client-side functionality that: Enables you to use the Like Button and other Social Plugins on your site. Enables you to use Facebook Login to lower the barrier for people to sign up on your site. Makes it easy to call into Facebook's Graph API.

What is Facebook SDK used for?

The Facebook SDK is a set of software components that developers can include in their mobile app to understand how people use the app, run optimized marketing campaigns and enable Facebook login and social sharing.


2 Answers

The best advice I can give you - be very careful when planning a new development on the Facebook Platform. A lot of the documentation is seriously out of date, and this is exacerbated by sporadic platform revisions.

Admittedly, this has improved in recent months, but I digress...

Facebook have recently deprecated the creation of FBML canvas applications, which means your application will have to be in an iframe. This also implies you could make the applications available off of Facebook too (e.g., http://apps.facebook.com/someapp/ and http://www.someapp.com/ can both load up). This narrows the benefits of using the PHP SDK, as a lot of the functionality is available via the JavaScript API.

like image 104
plasmid87 Avatar answered Sep 30 '22 11:09

plasmid87


For SDK authentication you should use the Javascript SDK. It's much easier to set up things properly.

For the Graph API, it depends what kind of application you are going to build. If you are storing or processing stuff on the server side then you will have to use the PHP SDK.

You don't need to use an SDK for their Social plugins. You just have to copy-paste sample code in most cases.

like image 34
Abhinav Avatar answered Sep 30 '22 12:09

Abhinav