Download the PHP package bootdesk/chat-sdk-core without Composer

On this page you can find all versions of the php package bootdesk/chat-sdk-core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chat-sdk-core

bootdesk/chat-sdk-core

Framework-agnostic core SDK for building chat bots in PHP.

Installation

Chat class

The main entry point. Accepts a state adapter, adapters, configuration, and optional ConcurrencyHandler.

Thread

Represents a conversation thread on any platform. Retrieved by platform-specific identifier.

Cards

Build rich, platform-adaptive message cards with text, tables, dividers, links, buttons, and more.

Element types

Builder method Type Description
header(string) Card title (rendered as bold header)
section(callable) Section Grouped text + fields
text(string, TextStyle) Text Styled text (Bold, Muted, Plain)
divider() Divider Horizontal separator (---)
link(label, url) Link Inline hyperlink
table(headers, rows, align) Table Data table with optional column alignment
image(url, alt) Image Embedded image
actions(Button[]) Button Action buttons (triggers onAction)
linkButton(label, url, style) LinkButton URL button (opens link)

Text styles

Buttons

Table with alignment

Full example

Card imageUrl

Set a header image that renders as a native image block on supported platforms:

Sections with fields

Platform rendering

Each adapter converts cards to its native format:

Adapter Format
Slack Block Kit (header, section, divider, image, actions)
Discord Embed + Action Row components
Telegram HTML text + inline keyboard
WhatsApp Interactive reply buttons or text fallback
Messenger Generic/Button template
GitHub Markdown (headings, pipe tables, links)
Linear Markdown (same as GitHub)

Attachments & File Uploads

Send URL-based media attachments or binary file uploads with any message.

URL-based Attachments

All adapters support URL-based attachments. Platforms without native attachment rendering fall back to text links.

Binary File Uploads

Native support: Slack (3-step API), Telegram (sendDocument), Discord (files[N] multipart).

Other platforms: Binary files are converted to URL-based attachments via a FileUploadConverter. If no converter is registered, AdapterException is thrown.

FileUploadConverter

In Laravel, bind it in your service provider:

Conversations

Define multi-turn dialog flows by extending the Conversation class.

Start a conversation:

Middleware

Three middleware interfaces for intercepting different stages:

Extending Adapters

All adapters use protected members for extensibility. Extend any adapter to customize behavior:

Register your custom adapter via AdapterRegistry:

With AdapterResolver: Dynamic resolution tries resolver first (tenant-specific), then falls back to static adapters from config (global default). This allows tenants to override specific adapters while using global defaults for others.

StateAdapter interface

The state adapter handles persistence, pub/sub, locking, and queuing. Methods:

Method Purpose
connect Establish connection to state store
disconnect Close connection
subscribe Subscribe to a channel
unsubscribe Unsubscribe from a channel
acquireLock Acquire a named lock with TTL (returns Lock or null)
releaseLock Release a previously acquired lock
extendLock Extend a lock's TTL (returns bool)
get Retrieve a value by key
set Store a value by key with optional TTL
delete Remove a value by key
enqueue Add item to a queue (max size configurable)
dequeue Remove and return item from a queue
queueDepth Get current queue size

Locks are used for concurrency control (drop/queue/debounce strategies). Queues store pending messages when concurrency: queue is set.

Concurrency is pluggable via ConcurrencyHandler. The core provides DefaultConcurrencyHandler (sync/blocking with usleep for debounce). Framework packages (e.g., Laravel) replace it with async implementations that dispatch jobs to workers. ConcurrencyHandler::process() accepts an optional ?ServerRequestInterface $request — framework packages can serialize it for jobs so AdapterResolver receives the original request in queued context. Adapters can declare sync/async preference via RequiresSyncResponse and RequiresAsyncResponse marker interfaces.

MessageContext

Passed to every event handler.

Event handlers

Method Pattern Description
onNewMessage regex Match text messages
onDirectMessage - DM-only messages
onNewMention - Bot was mentioned
onSubscribedMessage - Subscribed thread messages
onReaction emoji Reaction added/removed
onAction actionId Button/action triggered
onSlashCommand command Slash command
onModalSubmit callbackId Modal form submitted
onModalClose callbackId Modal form closed
onOptionsLoad actionId External select options requested
onAssistantThreadStarted - Slack assistant thread created
onAssistantContextChanged - Slack assistant context changed
onAppHomeOpened - Slack App Home tab opened
onMemberJoinedChannel - User joined a channel

Modals

Build and open platform-agnostic modal forms.

Value Objects

Opening Modals from Handlers

Both ActionEvent and SlashCommandEvent expose openModal() via the OpensModals trait:

Modal context (thread info) is stored server-side and restored when the modal is submitted or closed, so handlers have access to $event->relatedThread.

External Selects / Options Load

When using ExternalSelect, Slack sends block_suggestion events as the user types. Handle them with onOptionsLoad:

The return value must be an array of ['text' => string, 'value' => string]. The adapter converts to platform format.

Modal Events

Documentationn

Full API documentation: https://bootdesk.github.io/chat-sdk

License

MIT


All versions of chat-sdk-core with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
psr/http-client Version ^1.0
psr/http-message Version ^1.0|^2.0
psr/http-factory Version ^1.0
psr/log Version ^1.0|^2.0|^3.0
league/commonmark Version ^2.0
moneyphp/money Version ^4.9
ramsey/uuid Version ^4.0|^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bootdesk/chat-sdk-core contains the following files

Loading the files please wait ...