This tutorial will get you up and running with a working embedded dashboard in just 5 minutes. We’ll use a sample token and dashboard so you can see results immediately.
What You’ll Build
By the end of this tutorial, you’ll have:- ✅ A working embedded DataBrain dashboard
- ✅ Understanding of the core embedding concepts
- ✅ A foundation to build upon for production
Prerequisites
- Node.js 14+ installed
- A React, Vue, or vanilla JavaScript project
- 5 minutes of your time ⏱️
Step 1: Install the Package
Step 2: Import the Plugin
Add this import to your component or main file:Step 3: Run and View
Start your development server and you should see the sample dashboard! 🎉Congratulations! You’ve embedded your first DataBrain dashboard. The dashboard you’re seeing is a sample with demo data.
Understanding What You Built
Let’s break down the code:The Component
The Token
The Dashboard ID
Next: Make It Production-Ready
The sample above works great for testing, but for production you need to:1. Create Your Own Dashboard
- Create your own dashboard at app.usedatabrain.com
- Connect your database as a data source
- Build your metrics and dashboards
- Create a Data App for embedding
- Generate tokens from your backend (see below)
Complete Setup Guide
Follow the full setup process
2. Generate Tokens from Your Backend
Here’s how token generation works: Token Flow:Backend Example (Node.js)
Frontend Example (React)
Guest Token API
Complete token generation API docs
3. Customize the Dashboard
Add options to customize appearance and behavior:Component Options
Explore all customization options
Embed a Single Metric
You can also embed individual metrics instead of full dashboards:Common Customizations
- Hide Elements
- Enable Downloads
- Custom Theme
- Event Handlers
Framework-Specific Guides
Get detailed integration guides for your framework:React
React integration guide
Next.js
Next.js with SSR support
Vue
Vue 3 integration
Angular
Angular setup guide
Svelte
Svelte integration
Vanilla JS
Plain JavaScript
Troubleshooting
Dashboard not rendering
Dashboard not rendering
Check:
- Plugin is imported before component renders
- Token is valid and not expired
- Dashboard ID is correct
- No console errors
Token expired error
Token expired error
Solution: Generate a fresh token from your backend. Guest tokens can be set to expire after a certain time.
CORS errors
CORS errors
Fix: Ensure your domain is whitelisted in the Data App settings. Or generate tokens from your backend instead of frontend.
Styling issues
Styling issues
Try:
- Check for CSS conflicts
- Use custom theme options
- Wrap in a container div
- Check z-index values
Troubleshooting Guide
Complete troubleshooting reference
What’s Next?
You’ve successfully embedded a DataBrain dashboard! Here’s what to explore next:Complete Setup
Production-ready setup guide
Security & Auth
Multi-tenancy and access control
Customization
Advanced customization options
API Reference
Complete API documentation
Need Help?
Interactive Playground
Experiment with live examples
Community & Support
Get help from our team

