API Reference
Complete reference for the Flotify JavaScript API.
Flotify.init(config)
Initialize the widget and mount it to the page. Returns the widget instance.
const widget = Flotify.init({
provider: 'trello',
trello: { apiKey, token, listId },
position: 'bottom-right',
theme: 'light',
accentColor: '#09090b',
})If called multiple times, the previous widget is destroyed before creating a new one.
Flotify.destroy()
Remove the widget from the page and clean up all event listeners.
Flotify.destroy()Call this in your component's cleanup function (e.g., React's useEffect return or Vue's onUnmounted).
Flotify.open()
Programmatically open the feedback form. Useful for triggering the widget from a custom button.
// Custom feedback button
document.getElementById('my-btn').addEventListener('click', () => {
Flotify.open()
})Flotify.close()
Programmatically close the feedback form.
Flotify.close()Flotify.toggle()
Toggle the feedback form open/closed.
Flotify.toggle()TypeScript Types
Types
import type {
FlotifyConfig,
Feedback,
FeedbackType,
Priority,
FeedbackProvider,
} from '@flotify/widget'
// FeedbackType = 'bug' | 'feature' | 'question'
// Priority = 'low' | 'medium' | 'high'
// Feedback shape:
interface Feedback {
type: FeedbackType
title: string
description?: string
priority: Priority
screenshot?: Blob
metadata: {
url: string
userAgent: string
screenSize: string
timestamp: string
}
}
// Provider interface (for custom integrations):
interface FeedbackProvider {
name: string
submit(feedback: Feedback): Promise<{
success: boolean
url?: string
error?: string
}>
}Trello Card Format
When a user submits feedback, Flotify creates a Trello card with this structure:
Title: [🐛 Bug] Button not working on mobile
Description:
The submit button doesn't respond to taps on iOS Safari.
---
**Type:** 🐛 Bug
**Priority:** 🔴 high
**Metadata**
- **URL:** https://example.com/checkout
- **Browser:** Mozilla/5.0 (iPhone; CPU iPhone OS 17_0...)
- **Screen:** 390x844
- **Time:** 2026-02-25T14:30:00.000Z
*Sent via Flotify*
Attachment: screenshot.png (set as card cover)