facebook/graph-sdk
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The Facebook SDK for PHP, also known as facebook/graph-sdk, is an open-source library that empowers developers to leverage the Facebook Platform from within their PHP applications. Equipped with this package, developers can comfortably interact with Facebook's Graph API, and integrate the many services Facebook offers, directly into their PHP applications.
Utilizing the facebook/graph-sdk is fairly straightforward. First, it requires the installation of the SDK, which is conveniently done through Composer, a popular dependency manager for PHP. Simply run composer require facebook/graph-sdk
in the command line within your application's directory.
Once the library is installed, the SDK can be used with the following example PHP code:
require_once __DIR__ . '/vendor/autoload.php'; // change path as needed
$fb = new \Facebook\Facebook([
'app_id' => '{app-id}',
'app_secret' => '{app-secret}',
'default_graph_version' => 'v2.10',
//'default_access_token' => '{access-token}', // optional
]);
// Additional code for using the library
In this example, {app-id}
and {app-secret}
are placeholders for your Facebook app's credentials, which you receive upon registering the app with Facebook. The 'default_graph_version' is set to 'v2.10', but the version should be picked based on the specifics of the developer's application.
The complete documentation containing installation instructions and usage examples for the Facebook SDK for PHP can be found in the docs directory of its GitHub repository. The documentation is a valuable resource for developers looking to bootstrap their Facebook integration journey with PHP applications.