{"id":37006589,"url":"https://github.com/codd-tech/bap-sdk-php","last_synced_at":"2026-01-14T00:45:40.595Z","repository":{"id":171247160,"uuid":"560558924","full_name":"codd-tech/bap-sdk-php","owner":"codd-tech","description":"Bot Advertising Platform SDK","archived":false,"fork":false,"pushed_at":"2024-05-12T10:16:12.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-01T21:29:54.564Z","etag":null,"topics":["advertising","cpa","php","php-library","sdk","telegram"],"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/codd-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-01T19:03:34.000Z","updated_at":"2024-05-12T10:16:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"79eb56c0-073c-479d-93ea-ddbabbf8d97e","html_url":"https://github.com/codd-tech/bap-sdk-php","commit_stats":null,"previous_names":["codd-tech/bap-sdk-php"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/codd-tech/bap-sdk-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codd-tech%2Fbap-sdk-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codd-tech%2Fbap-sdk-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codd-tech%2Fbap-sdk-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codd-tech%2Fbap-sdk-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codd-tech","download_url":"https://codeload.github.com/codd-tech/bap-sdk-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codd-tech%2Fbap-sdk-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["advertising","cpa","php","php-library","sdk","telegram"],"created_at":"2026-01-14T00:45:39.853Z","updated_at":"2026-01-14T00:45:40.587Z","avatar_url":"https://github.com/codd-tech.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bot Advertising Platform SDK\n\nThis repository holds SDK related to\n[Bot Advertising Platform](https://publisher.socialjet.pro/).\n\n## Requirements\n\n- PHP 5.3 or later\n- ext-sockets\n\n## Installation\n\nInstall the latest version with\n\n```bash\ncomposer require codd-tech/bap-sdk-php\n```\n\n### Installing ext-sockets\n\nThe [socket extension](https://www.php.net/manual/en/book.sockets.php) implements a low-level interface to the socket communication.\n\nThe BAP SDK uses the UDP protocol for data transfer to ensure minimal SDK overhead for the user.\n\nTo install socket extension add the following line to your `php.ini`:\n\n```ini\nextension=php_sockets.dll\n```\n\nOr add `RUN docker-php-ext-install sockets` to your project's Dockerfile if you are using [official php image](https://hub.docker.com/_/php). \n\n\n\n## Usage\n\nSDK accepts single update from the Telegram bot as an associative array.\n\n### Basic usage\n\n```php\n$bap = new \\CoddTech\\Bap\\BAP('\u003capi key\u003e');\n$bap-\u003ehandleTelegramUpdates($update);\n```\n\nIf your advertisement mode is set to **manual** you can mark ad placement in your code by calling:\n```php\n$bap-\u003eadvertisement($update);\n```\n\n**Interrupting control flow**\n\nAt times, BAP may introduce telegram updates within its advertisement flow. To maintain the logical consistency of your bot, it is necessary to ignore such updates.  \n\nThe `BAP::handleTelegramUpdates` method returns a boolean value indicating whether you should proceed with handling the request or skip it as an internal BAP request.\n\nWhen the method returns `false`, it signifies that the current request should not be processed by your bot.\n\n### Usage with PHP Telegram Bot package\n\nIf you are using [PHP Telegram Bot]() package you can call SDK inside custom update filter, eg:\n\n```php\n$telegram = new Longman\\TelegramBot\\Telegram($bot_api_key, $bot_username);\n\n$bap = new \\CoddTech\\Bap\\BAP('\u003capi key\u003e');\n$telegram-\u003esetUpdateFilter(function (Update $update, Telegram $telegram, \u0026$reason = 'Update denied by update_filter') use ($bap) {\n    return $bap-\u003ehandleTelegramUpdates($update-\u003egetRawData());\n});\n```\n\nFor manual advertisement mode(Should be turned on in settings) call following in the desired ad placements.\n\n```php\n$bap-\u003eadvertisement($update);\n```\n\n### API Key\n\n**API key is not your Telegram bot token.**\n\nAPI key must be obtained from [socialjet.pro](https://publisher.socialjet.pro/)\n\n## About\n\n### Submitting bugs and feature requests\n\nBugs and feature request are tracked on [GitHub](https://github.com/codd-tech/bap-sdk-php)\n\n### License\n\nBot Advertising Platform SDK is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodd-tech%2Fbap-sdk-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodd-tech%2Fbap-sdk-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodd-tech%2Fbap-sdk-php/lists"}