WebAdapterConfig
in package
Configuration class for WebAdapter.
Extend this class and override only the methods you need. All methods return safe defaults so minimal configuration is required.
Tags
Table of Contents
Methods
- fetchChannelInfo() : ChannelInfo|null
- Fetch channel info.
- fetchMessages() : FetchResult
- Fetch messages for a conversation.
- fetchThread() : ThreadInfo
- Fetch thread info for a conversation.
- getAuthorInfo() : Author
- Resolve author info (locale, language, timezone) for a user.
- getUser() : array{id: string, name?: string}|null
- Resolve the current user from the request.
- threadIdFor() : string
- Build a thread ID from user and conversation identifiers.
- verifySignature() : true|string
- Verify the request signature/authenticity.
Methods
fetchChannelInfo()
Fetch channel info.
public
fetchChannelInfo(string $channelId) : ChannelInfo|null
Override to provide custom channel details. The channel ID should use the canonical format "web:{userId}:{conversationId}".
Parameters
- $channelId : string
-
Channel ID (format: "web:{userId}:{conversationId}").
Return values
ChannelInfo|nullfetchMessages()
Fetch messages for a conversation.
public
fetchMessages(string $threadId[, FetchOptions|null $options = null ]) : FetchResult
Override to provide custom message history.
Parameters
- $threadId : string
-
Canonical thread ID (format: "web:{userId}:{conversationId}").
- $options : FetchOptions|null = null
-
Fetch options for pagination.
Return values
FetchResultfetchThread()
Fetch thread info for a conversation.
public
fetchThread(string $threadId) : ThreadInfo
Override to provide custom thread details. Both the id and channelId in the returned ThreadInfo should use the canonical format "web:{userId}:{conversationId}".
Parameters
- $threadId : string
-
Canonical thread ID (format: "web:{userId}:{conversationId}").
Return values
ThreadInfogetAuthorInfo()
Resolve author info (locale, language, timezone) for a user.
public
getAuthorInfo(Author $author) : Author
Override to return an enriched Author with localization data from your database, session, or API.
Parameters
- $author : Author
Return values
AuthorgetUser()
Resolve the current user from the request.
public
getUser(ServerRequestInterface $request) : array{id: string, name?: string}|null
Parameters
- $request : ServerRequestInterface
Return values
array{id: string, name?: string}|null —User data or null if unauthenticated
threadIdFor()
Build a thread ID from user and conversation identifiers.
public
threadIdFor(string $userId, string $conversationId) : string
Parameters
- $userId : string
-
The resolved user ID
- $conversationId : string
-
The conversation ID from the request
Return values
stringverifySignature()
Verify the request signature/authenticity.
public
verifySignature(ServerRequestInterface $request) : true|string
Parameters
- $request : ServerRequestInterface
Return values
true|string —True if valid, or an error message string if invalid