Workshop 7: Distribution & Deployment
Duration: 45 minutes | Level: Intermediate | Prerequisites: Workshops 1-3
What Youβll Master
Take your experts from development to production by deploying them across multiple channels.
Distribution Channels
Learn about different ways to deploy your experts
Embed Widgets
Add your expert to any website with simple code
API Integration
Connect your expert to applications via API
B-Bot Chat
Publish to the B-Bot mobile app
Custom Deployment
Advanced deployment strategies
Distribution Options
B-Bot provides multiple ways to share your experts:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DISTRIBUTION CHANNELS β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Embed β β API β β B-Bot β β
β β Widget β β Access β β Chat β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β β β β
β βΌ βΌ βΌ β
β Website chat Backend Mobile app β
β integration integration distribution β
β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Telegram β β Slack β β Custom β β
β β Bot β β Bot β β Channels β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β β β β
β βΌ βΌ βΌ β
β Chat platform Team workspace Your own β
β integration integration implementation β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Embed Widget Add to any website with a simple script tag
API Access Full programmatic control via REST API
B-Bot Chat Publish to the consumer chat app
Distribution Channels in Hub
Navigate to Channels
Click Channels in the sidebar
View existing channels or create new ones
Channel Types
Channel Best For Setup Complexity Web Embed Websites, landing pages β Easy API Custom apps, backends βββ Advanced B-Bot Chat Mobile users ββ Medium Telegram Community/support bots ββ Medium Slack Team workspaces ββ Medium
Creating an Embed Channel
Go to Channels
Navigate to Channels in the sidebar
Create New Channel
Click βCreate Distribution Channelβ
Select Embed
Choose βWeb Embedβ as the channel type
Configure Settings
Set up appearance and behavior
Get Code
Copy the embed code
Embed Code Example
<!-- B-Bot Expert Embed -->
< script
src = "https://chat.b-bot.space/embed.js"
data-channel-id = "your-channel-id"
data-position = "bottom-right"
data-primary-color = "#731f7d"
async >
</ script >
Customization Options
Where the chat bubble appears:
bottom-right (default)
bottom-left
top-right
top-left
Brand your widget:
data-primary-color: Main button color
data-text-color: Text color
data-background-color: Chat background
Control widget behavior:
data-auto-open: Open automatically
data-greeting: Welcome message
data-show-branding: Show B-Bot logo
Customize dimensions:
data-width: Widget width (px)
data-height: Widget height (px)
π― Exercise: Create Your First Embed
Create Test HTML
Create a simple HTML file: <! DOCTYPE html >
< html >
< head >
< title > My Website with B-Bot </ title >
</ head >
< body >
< h1 > Welcome to My Website </ h1 >
< p > Click the chat bubble to talk to our AI assistant! </ p >
<!-- B-Bot Embed -->
< script
src = "https://chat.b-bot.space/embed.js"
data-channel-id = "YOUR-CHANNEL-ID"
async >
</ script >
</ body >
</ html >
Replace Channel ID
Add your channel ID from the Hub
Open in Browser
Test the embed locally
Customize
Try different color and position options
API Integration
Getting API Access
Create API Channel
Create a new channel with type βAPIβ
Generate API Key
Create an API key for authentication
Note Endpoints
Save the base URL and channel ID
API Endpoints
Stream Response Real-time streaming POST /threads/{id}/runs/stream
Basic API Usage
import requests
BASE_URL = "https://api.b-bot.space"
API_KEY = "your-api-key"
CHANNEL_ID = "your-channel-id"
# Create a thread
thread = requests.post(
f " { BASE_URL } /threads" ,
headers = { "Authorization" : f "Bearer { API_KEY } " },
json = { "channel_id" : CHANNEL_ID }
).json()
# Send a message
response = requests.post(
f " { BASE_URL } /threads/ { thread[ 'thread_id' ] } /runs" ,
headers = { "Authorization" : f "Bearer { API_KEY } " },
json = {
"input" : [{ "role" : "user" , "content" : "Hello!" }]
}
).json()
print (response)
const BASE_URL = "https://api.b-bot.space" ;
const API_KEY = "your-api-key" ;
const CHANNEL_ID = "your-channel-id" ;
// Create a thread
const thread = await fetch ( ` ${ BASE_URL } /threads` , {
method: "POST" ,
headers: {
"Authorization" : `Bearer ${ API_KEY } ` ,
"Content-Type" : "application/json"
},
body: JSON . stringify ({ channel_id: CHANNEL_ID })
}). then ( r => r . json ());
// Send a message
const response = await fetch (
` ${ BASE_URL } /threads/ ${ thread . thread_id } /runs` ,
{
method: "POST" ,
headers: {
"Authorization" : `Bearer ${ API_KEY } ` ,
"Content-Type" : "application/json"
},
body: JSON . stringify ({
input: [{ role: "user" , content: "Hello!" }]
})
}
). then ( r => r . json ());
console . log ( response );
# Create a thread
curl -X POST https://api.b-bot.space/threads \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"channel_id": "your-channel-id"}'
# Send a message
curl -X POST https://api.b-bot.space/threads/THREAD_ID/runs \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"input": [{"role": "user", "content": "Hello!"}]}'
Streaming Responses
For real-time responses, use Server-Sent Events:
const eventSource = new EventSource (
` ${ BASE_URL } /threads/ ${ threadId } /runs/stream?` +
new URLSearchParams ({
input: JSON . stringify ([{ role: "user" , content: "Hello!" }])
}),
{
headers: { "Authorization" : `Bearer ${ API_KEY } ` }
}
);
eventSource . onmessage = ( event ) => {
const data = JSON . parse ( event . data );
console . log ( "Chunk:" , data );
};
B-Bot Chat App
Publishing to B-Bot Chat
B-Bot Chat is the consumer-facing mobile app where users can discover and chat with published experts.
Prepare Your Expert
Ensure your expert is well-tested and polished
Create B-Bot Chat Channel
Add a βB-Bot Chatβ distribution channel
Configure Public Profile
Set up how your expert appears in the app:
Display name
Description
Category
Tags
Set Pricing (Optional)
Configure if users pay per message or subscribe
Submit for Review
Your expert will be reviewed before going live
Public Profile Settings
Field Description Tips Display Name Name shown to users Keep it clear and memorable Short Description Brief summary Focus on user benefits Category Classification Choose the best fit Tags Searchable keywords Add relevant terms Profile Image Expert avatar Use a professional image
Advanced Deployment
A2A (Agent-to-Agent) Protocol
Enable your expert to communicate with other agents:
# Configure A2A endpoint
channel_config = {
"type" : "a2a" ,
"endpoint" : "https://your-agent.com/.well-known/agent.json" ,
"capabilities" : [ "text" , "files" , "tools" ]
}
Webhooks
Receive notifications about conversations:
webhook_config = {
"url" : "https://your-server.com/webhook" ,
"events" : [
"thread.created" ,
"message.sent" ,
"message.received" ,
"tool.executed"
],
"secret" : "your-webhook-secret"
}
Multi-Channel Strategy
Deploy across multiple channels:
Your Expert
βββ Website Embed (customer support)
βββ B-Bot Chat (public access)
βββ Slack Bot (internal team)
βββ API (custom apps)
βββ Telegram (community support)
Monitoring & Analytics
Channel Metrics
Track performance across channels:
Metric Description Conversations Total threads created Messages Messages exchanged Response Time Average response latency Satisfaction User ratings Token Usage AI tokens consumed
Dashboard View
Navigate to Dashboard to see:
Usage statistics
Popular queries
Error rates
User feedback
Security Considerations
API Keys
Rotate keys regularly
Use environment variables
Never expose in frontend code
CORS
Configure allowed origins
Restrict embed domains
Validate referrers
Rate Limiting
Set request limits
Implement cooldowns
Monitor for abuse
Data Privacy
Enable data deletion
Configure retention
Handle PII carefully
π― Challenge: Multi-Channel Deployment
Deploy your TechSupport AI across multiple channels:
Create Web Embed
Set up an embed for a support website
Create API Channel
Build a simple integration
Test Both Channels
Verify consistent behavior
Monitor Analytics
Compare usage across channels
Key Takeaways
Multiple Channels Deploy the same expert across different platforms
Easy Embedding Simple code snippets for website integration
Full API Control Complete programmatic access for custom apps
Mobile Ready Publish to B-Bot Chat for consumer access
Next Steps