Quick Start Guide
Get your TekstiAI Widget up and running in 5 minutes!
Prerequisites
Before you begin, you'll need:
- A TekstiAI account with a valid
widget_id
Installation
Include the widget script in your HTML using a script tag:
<script src="https://cdn.teksti.ai/widget/v2/tekstiai.js"></script>
info
The widget is distributed as a JavaScript file. Contact your TekstiAI account manager for access to the latest widget file and CDN URL.
Basic Setup
Step 1: Add the Widget Element
Add the custom element to your HTML where you want the widget to appear:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>My App with TekstiAI</title>
</head>
<body>
<!-- Your content -->
<!-- TekstiAI Widget -->
<tekstiai-widget></tekstiai-widget>
<!-- Widget script -->
<script src="https://cdn.teksti.ai/widget/v2/tekstiai.js"></script>
</body>
</html>
Step 2: Initialize the Widget
Add a script to initialize the widget with your configuration:
<script>
document.addEventListener("DOMContentLoaded", function () {
window.TekstiAI("boot", {
widget_id: "your-widget-id-here"
});
});
</script>
Step 3: Style the Container (Optional)
Control the widget's size and position with CSS:
<style>
tekstiai-widget {
display: block;
width: 400px;
height: 600px;
border-radius: 16px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
/* For mobile */
@media (max-width: 768px) {
tekstiai-widget {
width: 100%;
height: 100vh;
border-radius: 0;
}
}
</style>
Complete Example
Here's a complete, working example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TekstiAI Widget Demo</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen, Ubuntu, Cantarell, sans-serif;
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
tekstiai-widget {
display: block;
width: 400px;
height: 600px;
border-radius: 16px;
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
@media (max-width: 768px) {
body {
padding: 0;
}
tekstiai-widget {
width: 100%;
height: 100vh;
border-radius: 0;
}
}
</style>
</head>
<body>
<tekstiai-widget></tekstiai-widget>
<script src="https://cdn.teksti.ai/widget/v2/tekstiai.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
window.TekstiAI("boot", {
widget_id: "your-widget-id-here",
});
});
</script>
</body>
</html>
Next Steps
- Explore all options — See the Configuration Reference for all available parameters
Common Issues
Widget Doesn't Appear
Make sure:
- The script is loaded before calling
window.TekstiAI() - Your
widget_idis correct
Authentication Errors
Verify:
- Your widget ID matches your TekstiAI account
- Network requests aren't blocked by CORS or ad blockers