enhancementgood first issueintegrationnew-featurenew-integration
Metriche repository
- Star
- (1930 stelle)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Description
Add Excalidraw integration to sync whiteboard drawings, collaborative sessions, and diagram updates into CORE.
Reference Implementations
Existing Integrations (use as templates)
integrations/notion/- Similar document/content systemintegrations/google-docs/- Document management integrationintegrations/slack/- For reference
Required Files Structure
integrations/excalidraw/
├── src/
│ ├── index.ts # Main entry, API spec
│ ├── schedule.ts # Sync logic
│ ├── utils.ts # Excalidraw API utilities
│ ├── account-create.ts # Auth setup
│ └── create-activity.ts # Activity formatting
├── package.json
├── tsup.config.ts
└── README.md
Excalidraw API Integration
Authentication Setup
- Use Excalidraw+ API token authentication for cloud-hosted instances
- Self-hosted instances may use custom auth mechanisms
- The
@excalidraw/excalidrawnpm package provides the React component API
Key APIs
- ExcalidrawAPI - Core API accessed via
excalidrawAPIpropupdateScene(sceneData)- Update drawings programmaticallygetSceneElements()- Retrieve current scene elementsgetFiles()- Get binary files (images) in the sceneexportToBlob()- Export drawing as image blobexportToSvg()- Export drawing as SVG
- Collaboration API - Real-time collaboration endpoints
- WebSocket-based real-time sync
- Room management for shared drawings
- REST API (Excalidraw+) - Cloud platform endpoints
- Scene CRUD operations
- Team/workspace management
- File storage and retrieval
Events to Track
- Drawing Activity - New drawings created, existing drawings modified, drawings deleted
- Collaboration - Users joining/leaving shared sessions, real-time edits
- Export Events - Drawings exported to PNG, SVG, or other formats
- Library Updates - Custom shape libraries added or modified
Implementation Tasks
- Set up basic integration structure following
integrations/github/src/index.tspattern - Implement Excalidraw+ token authentication flow in
account-create.ts - Create API utilities in
utils.ts - Implement sync logic in
schedule.tsfor drawings and collaboration events - Convert drawing events to CORE activity format
- Add error handling and rate limiting
- Create integration documentation
- Add to
integrations/README.md
Technical Notes
- Excalidraw is open-source; self-hosted instances can use Docker deployment
- The React component (
@excalidraw/excalidraw) does not support SSR - must be client-side rendered - Drawings are stored as JSON scene data with element arrays
- Binary files (images) are stored separately and referenced by ID
- Used by VSCode, Obsidian, Notion, CodeSandbox, and Google Cloud
Resources
- Excalidraw Developer Docs
- Excalidraw API Reference
- ExcalidrawAPI Props
- Integration Guide
- Utils Documentation
Labels
enhancement, integration, new-feature