Skip to main content

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.
1

Distribution Channels

Learn about different ways to deploy your experts
2

Embed Widgets

Add your expert to any website with simple code
3

API Integration

Connect your expert to applications via API
4

B-Bot Chat

Publish to the B-Bot mobile app
5

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

  1. Click Channels in the sidebar
  2. View existing channels or create new ones

Channel Types

ChannelBest ForSetup Complexity
Web EmbedWebsites, landing pages⭐ Easy
APICustom apps, backends⭐⭐⭐ Advanced
B-Bot ChatMobile users⭐⭐ Medium
TelegramCommunity/support bots⭐⭐ Medium
SlackTeam workspaces⭐⭐ Medium

Embed Widget

Creating an Embed Channel

1

Go to Channels

Navigate to Channels in the sidebar
2

Create New Channel

Click β€œCreate Distribution Channel”
3

Select Embed

Choose β€œWeb Embed” as the channel type
4

Configure Settings

Set up appearance and behavior
5

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

1

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>
2

Replace Channel ID

Add your channel ID from the Hub
3

Open in Browser

Test the embed locally
4

Customize

Try different color and position options

API Integration

Getting API Access

1

Create API Channel

Create a new channel with type β€œAPI”
2

Generate API Key

Create an API key for authentication
3

Note Endpoints

Save the base URL and channel ID

API Endpoints

Create Thread

Start a new conversation
POST /threads

Send Message

Send a message
POST /threads/{id}/runs

Get History

Retrieve conversation
GET /threads/{id}/state

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)

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.
1

Prepare Your Expert

Ensure your expert is well-tested and polished
2

Create B-Bot Chat Channel

Add a β€œB-Bot Chat” distribution channel
3

Configure Public Profile

Set up how your expert appears in the app:
  • Display name
  • Description
  • Category
  • Tags
4

Set Pricing (Optional)

Configure if users pay per message or subscribe
5

Submit for Review

Your expert will be reviewed before going live

Public Profile Settings

FieldDescriptionTips
Display NameName shown to usersKeep it clear and memorable
Short DescriptionBrief summaryFocus on user benefits
CategoryClassificationChoose the best fit
TagsSearchable keywordsAdd relevant terms
Profile ImageExpert avatarUse 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:
MetricDescription
ConversationsTotal threads created
MessagesMessages exchanged
Response TimeAverage response latency
SatisfactionUser ratings
Token UsageAI 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:
1

Create Web Embed

Set up an embed for a support website
2

Create API Channel

Build a simple integration
3

Test Both Channels

Verify consistent behavior
4

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