{"id":33967826,"url":"https://github.com/sohaibilyas/facebook-php-sdk","last_synced_at":"2025-12-12T23:56:04.229Z","repository":{"id":55966633,"uuid":"258866378","full_name":"sohaibilyas/facebook-php-sdk","owner":"sohaibilyas","description":"Easy to use PHP SDK to interact with Facebook API.","archived":false,"fork":false,"pushed_at":"2024-09-21T00:52:30.000Z","size":44,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T23:28:17.386Z","etag":null,"topics":["facebook-api","facebook-graph-api","facebook-marketing-api","facebook-php-sdk"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sohaibilyas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-25T20:20:29.000Z","updated_at":"2025-05-09T13:14:30.000Z","dependencies_parsed_at":"2022-08-15T10:30:58.969Z","dependency_job_id":null,"html_url":"https://github.com/sohaibilyas/facebook-php-sdk","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/sohaibilyas/facebook-php-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohaibilyas%2Ffacebook-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohaibilyas%2Ffacebook-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohaibilyas%2Ffacebook-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohaibilyas%2Ffacebook-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sohaibilyas","download_url":"https://codeload.github.com/sohaibilyas/facebook-php-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohaibilyas%2Ffacebook-php-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27695638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["facebook-api","facebook-graph-api","facebook-marketing-api","facebook-php-sdk"],"created_at":"2025-12-12T23:56:03.682Z","updated_at":"2025-12-12T23:56:04.223Z","avatar_url":"https://github.com/sohaibilyas.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Facebook PHP SDK\n\nEasy to use PHP SDK to interact with Facebook API.\n\n## Installation\n\nUse the composer to install.\n\n```bash\ncomposer require sohaibilyas/facebook-php-sdk\n```\n\n## Usage\n\n```php\n\u003c?php\nsession_start();\n\nrequire './vendor/autoload.php';\n\nuse SohaibIlyas\\FacebookPhpSdk\\Facebook;\n\n$facebook = new Facebook([\n    'app_id' =\u003e 'app-id-here',\n    'app_secret' =\u003e 'app-secret-here',\n    'redirect_url' =\u003e 'https://sohaibilyas.com'\n]);\n\n$facebook-\u003ehandleRedirect(function($user) {\n    // save access token to use it later e.g. session, database\n    $_SESSION['access_token'] = $user-\u003eaccess_token;\n});\n\n// checking if access token is saved otherwise show login with facebook url\nif (isset($_SESSION['access_token'])) {\n    // setting default access token for all requests\n    $facebook-\u003esetAccessToken($_SESSION['access_token']);\n\n    // default response type e.g. object, json, array\n    $facebook-\u003esetResponseType('json');\n\n    // getting facebook user information\n    print_r($facebook-\u003egetAdAccounts());\n} else {\n    echo $facebook-\u003egetLoginUrl(['email', 'ads_management', 'business_management', 'ads_read']);exit;\n}\n```\n\n## License\n[MIT](https://choosealicense.com/licenses/mit/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsohaibilyas%2Ffacebook-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsohaibilyas%2Ffacebook-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsohaibilyas%2Ffacebook-php-sdk/lists"}