Frontend Components
Artos provides a single, embeddable Artos component that can be integrated into any React application. This component gives you complete access to the Artos platform while maintaining full control over authentication, styling, and user experience.Overview
The Artos frontend integration consists of one comprehensive component that provides access to the entire Artos platform - from workflow creation and execution to debugging and analytics. This component can be embedded in any React application with your own authentication layer and custom styling.What is the Artos Component?
The Artos component is a complete, embeddable interface to the Artos platform. It’s not just a set of individual components for specific backend operations - it’s a full-featured application that you can embed directly into your existing applications.Key Benefits
- Complete Platform Access: Full access to all Artos capabilities in one component
- Custom Authentication: Wrap with your own authentication and authorization layer
- Complete Styling Control: Full customization of appearance and branding
- Seamless Integration: Embeds naturally into existing React applications
- Responsive Design: Works on desktop, tablet, and mobile devices
- TypeScript Support: Full type safety and IntelliSense support
Installation and Setup
Package Installation
Install the Artos React component package:Basic Integration
The simplest way to integrate Artos into your application:With Authentication Wrapper
Integrate with your existing authentication system:Component Configuration
Props
The ArtosApp component accepts the following props:| Prop | Type | Default | Description |
|---|---|---|---|
apiKey | string | Required | Your Artos API key |
theme | 'light' | 'dark' | 'auto' | 'light' | Component theme |
userId | string | Optional | Current user ID for analytics |
userEmail | string | Optional | Current user email |
userRole | string | Optional | Current user role for permissions |
locale | string | 'en' | Language locale |
className | string | Optional | Custom CSS class name |
style | object | Optional | Inline styles |
onError | (error: Error) => void | Optional | Error handler |
onSuccess | (message: string) => void | Optional | Success handler |
onWorkflowCreate | (workflow: Workflow) => void | Optional | Workflow creation callback |
onWorkflowExecute | (execution: Execution) => void | Optional | Workflow execution callback |
customConfig | object | Optional | Advanced configuration options |
TypeScript Integration
Authentication Integration
Custom Authentication Layer
Wrap the Artos component with your authentication system:Role-Based Access Control
Implement role-based access control around the Artos component:Custom Styling and Theming
CSS Variables
The Artos component uses CSS variables for complete customization:Dark Theme Support
Custom Branding
Complete customization example:Responsive Design
Ensure the Artos component works well on all devices:Advanced Integration Patterns
Multi-Tenant Support
Support multiple tenants with different configurations:Custom Event Handling
Handle all events from the Artos component:Performance Optimization
Lazy Loading
Lazy load the Artos component to improve initial page load:Memory Management
Implement proper cleanup and memory management:Error Handling and Monitoring
Comprehensive Error Boundary
Best Practices
Security Considerations
- API Key Management: Never expose API keys in client-side code
- Authentication: Always wrap with proper authentication
- Authorization: Implement role-based access control
- Data Sanitization: Sanitize all user inputs
- HTTPS: Always use HTTPS in production
Performance Guidelines
- Lazy Loading: Load the component only when needed
- Caching: Implement proper caching strategies
- Virtualization: Use virtualization for large datasets
- Debouncing: Debounce user inputs to reduce API calls
- Memory Management: Implement proper cleanup
User Experience
- Loading States: Show appropriate loading indicators
- Error Messages: Provide clear, actionable error messages
- Responsive Design: Ensure mobile compatibility
- Accessibility: Follow WCAG guidelines
- Performance: Optimize for fast loading and smooth interactions
Troubleshooting
Common Issues
- Component Not Loading: Check API key and network connectivity
- Styling Issues: Verify CSS variables are properly defined
- Authentication Problems: Ensure proper token handling
- Performance Issues: Check for memory leaks and optimize renders
- Mobile Issues: Test responsive design on various devices