@timoai/node
v1.0.1
Published
Timo Node.js components for feedback and bug reporting
Maintainers
Readme
Timo Node.js Modal
A Node.js implementation of the Timo feedback modal component.
Installation
npm install @timoai/nodeUsage
import { TimoModal } from '@timoai/node';
// Create a new modal instance
const modal = new TimoModal({
apiKey: 'your-api-key',
baseUrl: 'https://api.timo.zeratus.com', // optional, defaults to production API
position: 'bottom-right', // optional
buttonLabel: 'Feedback', // optional
modalTitle: 'Submit Feedback', // optional
inputPlaceholder: 'Describe your issue', // optional
submitButtonLabel: 'Submit', // optional
logoSrc: 'path/to/logo.png', // optional
theme: { // optional
primaryColor: '#5c63ed',
secondaryColor: '#f3f4f6',
borderRadius: '12px',
fontFamily: 'Inter, system-ui, sans-serif'
},
metadata: { // optional
appVersion: '1.0.0',
environment: 'production'
},
showContextFields: false // optional
});
// Start the modal server
modal.start(3000); // port is optional, defaults to 3000
// To stop the server
modal.stop();Features
- Floating feedback button with customizable position
- Modal dialog with customizable theme
- Support for custom logo
- Optional context fields (severity and feature area)
- Customizable text and labels
- Responsive design
- TypeScript support
API
Configuration Options
| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Your Timo API key | | baseUrl | string | 'https://api.timo.zeratus.com' | API base URL | | position | 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'bottom-right' | Position of the feedback button | | buttonLabel | string | 'Complaint' | Text shown on the feedback button | | modalTitle | string | 'Submit Complaint' | Title of the modal dialog | | inputPlaceholder | string | 'Describe your issue' | Placeholder text for the feedback input | | submitButtonLabel | string | 'Submit' | Text shown on the submit button | | logoSrc | string | undefined | URL of the logo image to show on the button | | theme | object | {} | Custom theme options | | metadata | object | {} | Additional metadata to include with feedback | | showContextFields | boolean | false | Whether to show severity and feature area fields |
Theme Options
| Option | Type | Default | Description | |--------|------|---------|-------------| | primaryColor | string | '#5c63ed' | Primary color for buttons and accents | | secondaryColor | string | '#f3f4f6' | Secondary color for backgrounds | | borderRadius | string | '12px' | Border radius for elements | | fontFamily | string | 'Inter, system-ui, sans-serif' | Font family for text |
License
MIT
