Customization
JavaScript API
Programmatically control the Lumifeed widget.
JavaScript API
Once the widget script is loaded, window.Lumifeed exposes the full API.
Methods
open()
Open the feedback modal.
window.Lumifeed.open()close()
Close the feedback modal.
window.Lumifeed.close()identify(user)
Attach user context to all subsequent submissions.
window.Lumifeed.identify({
userId: "user_123", // required
name: "Ada Lovelace", // optional
email: "ada@example.com", // optional
plan: "pro", // optional — any custom attribute
company: "Acme", // optional
})reset()
Clear the identified user (e.g. on logout).
window.Lumifeed.reset()on(event, callback)
Listen for widget events.
window.Lumifeed.on("open", () => console.log("Widget opened"))
window.Lumifeed.on("close", () => console.log("Widget closed"))
window.Lumifeed.on("submit", (feedback) => {
console.log("Submitted:", feedback.id, feedback.message)
})TypeScript types
declare global {
interface Window {
Lumifeed: {
open(): void
close(): void
identify(user: { userId: string; name?: string; email?: string; [key: string]: unknown }): void
reset(): void
on(event: "open" | "close" | "submit", callback: (data?: unknown) => void): void
}
}
}