{"id":37000967,"url":"https://github.com/socheatsok78/manychat-block-sdk","last_synced_at":"2026-01-14T00:06:28.844Z","repository":{"id":49086182,"uuid":"228814562","full_name":"socheatsok78/manychat-block-sdk","owner":"socheatsok78","description":"ManyChat Block SDK (⚠️ Unofficial) — Send any message block, like text, gallery, list and others. Attach buttons with custom payloads to continue interaction.","archived":true,"fork":false,"pushed_at":"2023-07-19T22:11:28.000Z","size":1907,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-26T01:52:58.656Z","etag":null,"topics":["dynamic-content-block","manychat","manychat-sdk"],"latest_commit_sha":null,"homepage":"https://socheatsok78.github.io/manychat-block-sdk/","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/socheatsok78.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-12-18T10:21:59.000Z","updated_at":"2024-07-05T23:06:42.000Z","dependencies_parsed_at":"2023-02-17T18:01:17.601Z","dependency_job_id":null,"html_url":"https://github.com/socheatsok78/manychat-block-sdk","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/socheatsok78/manychat-block-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socheatsok78%2Fmanychat-block-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socheatsok78%2Fmanychat-block-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socheatsok78%2Fmanychat-block-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socheatsok78%2Fmanychat-block-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/socheatsok78","download_url":"https://codeload.github.com/socheatsok78/manychat-block-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/socheatsok78%2Fmanychat-block-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406479,"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":["dynamic-content-block","manychat","manychat-sdk"],"created_at":"2026-01-14T00:06:27.344Z","updated_at":"2026-01-14T00:06:28.810Z","avatar_url":"https://github.com/socheatsok78.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg alt=\"Dynamic Content Block\" src=\"resources/dynamic-content-block.png\" style=\"border-radius: 10px;\"\u003e\n\n# ManyChat Block SDK (:warning: Unofficial)\n\nSend any message block, like text, gallery, list and others. Attach buttons with custom payloads to continue interaction.\n\nTrigger actions in ManyChat, like tagging a user, setting a Custom Field or notifying an admin.\n\n### :warning: This is an Unofficial SDK, Use at your own risk!\n\n[![packagist](https://img.shields.io/packagist/v/socheatsok78/manychat-block-sdk)][packagist]\n[![packagist](https://img.shields.io/packagist/dm/socheatsok78/manychat-block-sdk)][packagist]\n[![license](https://img.shields.io/github/license/socheatsok78/manychat-block-sdk)](LICENSE)\n\n#### Example code:\n\n```php\nnamespace App\\Http\\Controllers\\Flow;\n\nuse ManyChat\\Dynamic\\Chat;\nuse Illuminate\\Http\\Request;\nuse App\\Http\\Controllers\\Controller;\n\nclass WelcomeMessage extends Controller\n{\n    /**\n     * Handle the incoming request.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @return \\Illuminate\\Http\\Response\n     */\n    public function __invoke(Request $request)\n    {\n        $chat = new Chat();\n\n        $text = new Text('Welcome to ManyChat Dynamic Response');\n        $chat-\u003ereply($text);\n\n        return $chat;\n    }\n}\n```\n#### Example response:\n\n```json\n{\n    \"version\": \"v2\",\n    \"content\": {\n        \"messages\": [\n            {\n                \"type\": \"text\",\n                \"text\": \"Welcome to ManyChat Dynamic Response\"\n            }\n        ],\n        \"actions\": [],\n        \"quick_replies\": []\n    }\n}\n```\n\n# Installation\nRequire `socheatsok78/manychat-block-sdk` package to your project\n\n```bash\ncomposer require socheatsok78/manychat-block-sdk\n```\n\nor edit `composer.json`\n\n```json\n{\n    \"require\": {\n        \"socheatsok78/manychat-block-sdk\": \"^1.0\"\n    },\n}\n```\n\nCheck [latest release here][github-releases]. See [CHANGELOG.md](CHANGELOG.md) for release notes.\n\n# Contents\n- [Messages](#Messages)\n- [Attachments](#Attachments)\n- [Buttons](#Buttons)\n- [Actions](#Actions)\n- [Quick Reply](#Quick-Reply)\n- [Dynamic Block](#Dynamic-Block)\n- [External Callback](#External-Callback)\n\n### Additional Documents\n- [docs](docs/README.md)\n- [laravel](docs/Laravel.md)\n\n### :rotating_light: Limitations\nDynamic block has a limit to have not more than 10 messages in messages block, 11 quick replies and 5 actions.\n\n| Type          | Limit |\n| ------------- | ----- |\n| Messages      | 10    |\n| Actions       | 5     |\n| Quick Replies | 11    |\n| Buttons       | 3     |\n\n## Messages\nCreate a message block like Text, List or Card.\n\n\u003e Note: A message can add up to 3 `Button` block, any thing more than that `ManyChat` will not show your response\n\n### Text\nCreate a `Text` message block for sending text messages.\n\nThe `Url`, `Flow`, `Node` and `Call` buttons can be used with `Text` block.\n\n```php\nuse ManyChat\\Dynamic\\Messages\\Text;\n\n$text = new Text('Example text message');\n\n# or\n\n$text = Text::create('Example text message');\n```\n\n### List\nCreate a list message block, a set of items vertically. There are two types of list `CompactList` and `LargeList`.\n\n- `CompactList`  renders each item identically and is useful for presenting a list of items where no item is shown prominently.\n\n- `LargeList` renders the first item with a cover image with text overlaid\n\nThe `Url`, `Flow`, `Node`, `Call` and `Buy` buttons can be used with `List` block.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n\u003e Warning: :warning: Vertical List will be deprecated by Facebook and will be rendered as a `Card`\n\n```php\nuse ManyChat\\Dynamic\\Messages\\Element;\nuse ManyChat\\Dynamic\\Messages\\LargeList;\nuse ManyChat\\Dynamic\\Messages\\CompactList;\n\n# You need to create at lease 2 Element block\n$element_1 = new Element([/* ... */]);\n$element_2 = new Element([/* ... */]);\n\n$compactList = new CompactList([$element_1, $element_2]);\n$largeList = new LargeList([$element_1, $element_2]);\n```\n\n### Card\nCreate a horizontal scrollable gallery. There are two types of card `SquareCard` and `HorizontalCard`.\n\nThe `Url`, `Flow`, `Node`, `Call` and `Buy` buttons can be used with `Card` block.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n```php\nuse ManyChat\\Dynamic\\Messages\\Element;\nuse ManyChat\\Dynamic\\Messages\\SquareCard;\nuse ManyChat\\Dynamic\\Messages\\HorizontalCard;\n\n# You need to create at lease 2 Element block\n$element_1 = new Element([/* ... */]);\n$element_2 = new Element([/* ... */]);\n\n$horizontalCard = new HorizontalCard([$element_1, $element_2]);\n$squareCard = new SquareCard([$element_1, $element_2]);\n```\n\n### Element\nCreate a element block. It can only be used on `List` or `Card` block.\n\nThe `Call`, `Url`, `Buy`, `Node` and `Flow` buttons can be used with `Element` block.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n```php\nuse ManyChat\\Dynamic\\Messages\\Element;\n\n$element = new Element();\n$element-\u003etitle = 'Unsplash';\n$element-\u003esubTitle = 'Photos for everyone';\n$element-\u003eimageUrl = 'https://source.unsplash.com/random';\n$element-\u003eactionUrl = 'https://unsplash.com';\n\n# or\n\n$element = new Element([\n    'title' =\u003e 'Unsplash',\n    'subTitle' =\u003e 'Photos for everyone',\n    'imageUrl' =\u003e 'https://source.unsplash.com/random',\n    'actionUrl' =\u003e 'https://unsplash.com',\n]);\n```\n\n## Attachments\nCreate a attachment block like File, Image, Audio and Video.\n\n### File\nCreate a file block to send any other files, which are no larger than 25 MB.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n```php\nuse ManyChat\\Dynamic\\Attachments\\File;\n\n$file = new File('/* URL to the file */');\n\n# or\n\n$file = File::url('/* URL to the file */');\n```\n\n### Image\nCreate an image block to send an image. `Image` supports JPG, PNG and GIF images.\n\nThe `Call`, `Url`, `Buy`, `Node` and `Flow` buttons can be used with `Element` block.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n```php\nuse ManyChat\\Dynamic\\Attachments\\Image;\n\n$image = new Image('https://source.unsplash.com/random');\n\n# or\n\n$image = Image::url('https://source.unsplash.com/random');\n```\n\n### Audio\nCreate an audio block send audio files, which are no larger than 25 MB.\n\nThe `Call`, `Url`, `Buy`, `Node` and `Flow` buttons can be used with `Element` block.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n```php\nuse ManyChat\\Dynamic\\Attachments\\Audio;\n\n$audio = new Audio('/* URL to the audio file */');\n\n# or\n\n$audio = Audio::url('/* URL to the audio file */');\n```\n\n### Video\nCreate an video block send video files, which are no larger than 25 MB.\n\nThe `Call`, `Url`, `Buy`, `Node` and `Flow` buttons can be used with `Element` block.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n```php\nuse ManyChat\\Dynamic\\Attachments\\Video;\n\n$video = new Video('/* URL to the video file */');\n\n# or\n\n$video = Video::url('/* URL to the video file */');\n```\n\n## Buttons\nCreate a button block like `Call`, `Url`, `Buy`, `Node` and `Flow`.\n\nYou can provide custom `Action` to be performed with the button. `Actions` can be attached to `Url`, `Flow` and `Node` button types.\n\n### Call\nCreate a call button block.\n\n```php\nuse ManyChat\\Dynamic\\Buttons\\Call;\n\n$call = new Call('+123456789');\n\n# or\n\n$call = Call::phone('+123456789');\n```\n\n### Url\nCreate a url button block.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n```php\nuse ManyChat\\Dynamic\\Buttons\\Url;\n\n$url = new Url('https://example.com');\n\n# or\n\n$url = Url::create('https://example.com');\n```\n\n`Url` has 3 style options:\n\n```php\nuse ManyChat\\Dynamic\\Buttons\\Url;\n\n$url = new Url('https://example.com');\n\n$url-\u003efull()     # 100 %, Default\n    -\u003emedium()   # 75 %\n    -\u003ecompact(); # 50 %\n```\n\n### Buy\nCreate a buy button block.\n\n```php\nuse ManyChat\\Dynamic\\Buttons\\Buy;\n\n$buy = new Buy('T-Shirt', 2000);\n\n# or\n\n$buy = Buy::create('T-Shirt', 2000);\n```\n\nYou can configure the `Buy` button payment option check the code below.\n\n```php\nuse ManyChat\\Dynamic\\Buttons\\Buy;\nuse ManyChat\\Dynamic\\Foundation\\Customer;\nuse ManyChat\\Dynamic\\Foundation\\Product;\n\n$buy = new Buy();\n\n# Update Product name and price\n$buy-\u003ewithProduct(function (Product $product) {\n    $product-\u003ename = 'T-Shirt';\n    $product-\u003eprice = 2000;\n});\n\n# Update Customer requirement\n$buy-\u003ewithCustomer(function (Customer $customer) {\n    $customer-\u003ewithContactName()    # Require contact name\n        -\u003ewithContactPhone()        # Require contact phone\n        -\u003ewithShippingAddress();    # Require shipping address\n\n    # or\n\n    $customer-\u003ewithoutContactName()    # Not require contact name\n        -\u003ewithoutContactPhone()        # Not require contact phone\n        -\u003ewithoutShippingAddress();    # Not require shipping address\n});\n```\n\n### Node\nCreate a node button block to link with existing flow.\n\nNode name can be found in its header, you need to use unique name for node connected with link. If there are multiple nodes with similar names inside of the same flow, transition behaviour would not meet expectations.\n\n```php\nuse ManyChat\\Dynamic\\Buttons\\Node;\n\n$node = new Node('Welcome Message');\n\n# or\n\n$node = Node::create('Welcome Message');\n```\n\n### Flow\n\nCreate a flow button block. `Flow` block are like `Node` block, but `Flow` uses `id` of a `Node` or `Flow`.\n\nThe `id` can be found in the address bar when you're editing the node/flow.\n\n```php\nuse ManyChat\\Dynamic\\Buttons\\Flow;\n\n$flow = new Flow('content20180221085508_278589');\n\n# or\n\n$flow = Flow::create('content20180221085508_278589');\n```\n\nExample node/flow url:\n```\n# URL: https://manychat.com/fb152631685162536/cms/files/content20191211074127_716888\n\nThe `content20191211074127_716888` is the `id` of the node/flow.\n```\n\n## Actions\nYou can attach actions to `Chat`, `Message`, `Attachment` or `Button` object.\n\nThere are only 2 type of actions `Tag` and `Custom Field`.\n\n\u003e Note: The `$object` can be `Chat`, `Message`, `Attachment` or `Button` object.\n\n### Add Tag\nAdd a tag to a subscriber\n\n```php\n$object-\u003eaddTag('tag_name');\n\n# or add multiple tags\n\n$object-\u003eaddTags(['tag_1', 'tag_2']);\n```\n\n### Remove Tag\nRemove a tag from a subscriber\n\n```php\n$object-\u003eremoveTag('tag_name');\n\n# or remove multiple tags\n\n$object-\u003eremoveTags(['tag_1', 'tag_2']);\n```\n\n### Add Custom Field\nAdd a custom field to a subscriber\n\n```php\n$object-\u003eaddField('Example_Field_1', 'value');\n\n# or add multiple custom fields\n\n$object-\u003eaddFields([\n    'Example_Field_1' =\u003e 'value',\n    'Example_Field_2' =\u003e 'value'\n]);\n```\n\n### Remove Custom Field\nRemove a custom field from a subscriber\n\n```php\n$object-\u003eremoveField('Example_Field_1');\n\n# or add multiple custom fields\n\n$object-\u003eremoveFields(['Example_Field_1', 'Example_Field_2']);\n```\n\n## Quick Reply\nCreate a quick reply block. Quick Reply can only be attached to `Chat` object.\n\nThe `Node`, `Flow` buttons and `DynamicBlock` callback can be used with Quick Reply block.\n\n```php\nuse ManyChat\\Dynamic\\Chat;\nuse ManyChat\\Dynamic\\Buttons\\Node;\nuse ManyChat\\Dynamic\\Buttons\\Flow;\n\n$chat = new Chat();\n\n$node = new Node('Welcome Message');\n$flow = new Flow('content20180221085508_278589');\n$dynamic = new DynamicBlock('https://example.com/api');\n\n$chat-\u003equickReply($node);\n$chat-\u003equickReply($flow);\n$chat-\u003equickReply($dynamic);\n```\n\n## Dynamic Block\nCreate a Dynamic Block callback.\n\n\u003e Note: We strongly suggest to use HTTPS protocol for your URLs\n\n```php\nuse ManyChat\\Dynamic\\Callback\\DynamicBlock;\n\n$dynamic = new DynamicBlock('https://example.com/api');\n\n# Set Block caption\n$dynamic-\u003esetCaption('Custom Caption');\n\n# Add HTTP request header\n$dynamic-\u003esetHeader('x-header', 'value');\n$dynamic-\u003esetHeaders([\n    'x-header-2' =\u003e 'value',\n    'x-header-2' =\u003e 'value'\n]);\n\n# Add HTTP request payload\n$dynamic-\u003esetPayload('key', 'value');\n$dynamic-\u003esetPayloads([\n    'key-1' =\u003e 'value',\n    'key-2' =\u003e 'value'\n]);\n```\n\n## External Callback\nYou can ask ManyChat to handle the next subscriber’s message on your side by using the `ExternalCallback` block.\n\n\u003e Note: Only one callback can be attached to `Chat` object.\n\n```php\nuse ManyChat\\Dynamic\\Chat;\nuse ManyChat\\Dynamic\\Callback\\ExternalCallback;\n\n$chat = new Chat();\n\n$external = new ExternalCallback('https://example.com/api/flow/2');\n\n# Add HTTP request header\n$external-\u003esetHeader('x-header', 'value');\n$external-\u003esetHeaders([\n    'x-header-2' =\u003e 'value',\n    'x-header-2' =\u003e 'value'\n]);\n\n# Add HTTP request payload\n$external-\u003esetPayload('key', 'value');\n$external-\u003esetPayloads([\n    'key-1' =\u003e 'value',\n    'key-2' =\u003e 'value'\n]);\n\n$chat-\u003ecallback($external);\n```\n\n## Trademark\nLogos, service marks and trade names are trademark of [ManyChat, Inc](https://manychat.com/).\n- [Term of Service](https://manychat.com/tos.html)\n- [Privacy Policy](https://manychat.com/privacy.html)\n\n### License\nThis package is an **Unofficial SDK** licensed under the [MIT](LICENSE)\n\n[packagist]: https://packagist.org/packages/socheatsok78/manychat-block-sdk\n[github-releases]: https://github.com/socheatsok78/manychat-block-sdk/releases/latest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocheatsok78%2Fmanychat-block-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsocheatsok78%2Fmanychat-block-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsocheatsok78%2Fmanychat-block-sdk/lists"}