Get started with boba.js CDN

MIT licensed

Boba.js is a lightweight library for creating interactive boba ball animations.

Tags:
  • analytics
  • tracking

Stable version

Copied!

How to start using boba.js CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with boba.js CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/boba.js/1.0.3/boba.min.js"></script>
  <style>
    #boba-chat {
      width: 300px;
      height: 500px;
      border: 1px solid #ccc;
      margin: 0 auto;
      padding: 10px;
      box-sizing: border-box;
    }
  </style>
</head>
<body>
  <div id="boba-chat"></div>
  <script>
    const boba = new Boba({
      el: '#boba-chat',
      greeting: 'Hello! How can I help you today?',
      endMessage: 'I hope I could help you. Have a great day!',
      placeholder: 'Type your message here...',
      onMessage: (message) => {
        console.log('You said:', message);
        const response = 'I understand your concern. Let me see what I can do.';
        boba.sendText(response);
      },
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!

All versions