DefPromo
AI-powered social media self-promotion assistant with comprehensive analytics and A/B testing capabilities.
Installation
- Chrome/Edge: Install from Chrome Web Store
- Firefox: Install from Firefox Add-ons
Features
- 🤖 AI Content Generation: Generate multiple promotional content variations using OpenAI
- 📊 Analytics Dashboard: Track performance across platforms with detailed metrics
- 🔄 A/B Testing: Compare content variation performance
- 💾 Data Portability: Export/import all data as JSON for cross-browser/machine use
- 🎯 Multi-Project Management: Manage multiple products simultaneously
- 🌐 Cross-Platform: Supports 14 platforms:
- Social Media: Twitter/X, LinkedIn, Facebook, Instagram, Threads, TikTok, YouTube
- Communities: Reddit, Stacker News
- Decentralized: Primal.net (Nostr)
- Messaging: Slack, Discord, Telegram
- Coming Soon: Bluesky (disabled to prevent account bans)
- 📱 Cross-Browser Sidebar: Content-script based sidebar works on all browsers without platform-specific APIs
Installation
Development Setup
-
Clone the repository
git clone https://github.com/ralyodio/defpromo.git cd defpromo -
Install dependencies
-
Build the extension
# Build for Chrome/Edge (default) pnpm build # or pnpm build:chrome # Build for Firefox pnpm build:firefox # Build for Safari pnpm build:safari # Build for all browsers pnpm build:all
Note: Each build automatically cleans its target directory before building, ensuring no stale code remains.
Load in Chrome/Edge
- Build:
pnpm build:chrome - Open
chrome://extensions/(oredge://extensions/) - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
dist/chromefolder
Load in Firefox
- Build:
pnpm build:firefox - Open
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Navigate to
dist/firefoxand selectmanifest.json
Load in Safari
Safari supports web extensions but requires conversion using Xcode:
- Build:
pnpm build:safari - Install Xcode from the Mac App Store
- Run the Safari Web Extension Converter:
xcrun safari-web-extension-converter dist/safari/
- Follow the prompts to create a Safari app project
- Open the generated Xcode project
- Build and run the project
- Enable the extension in Safari preferences
See Apple's documentation for detailed instructions.
Note: Safari conversion creates a native macOS/iOS app wrapper around the web extension. The extension code remains the same, but distribution requires the App Store or developer signing.
Usage
Initial Setup
- Click the DefPromo extension icon in your browser toolbar (or press
Ctrl+Shift+S/Cmd+Shift+S) - The sidebar will appear on the right side of the page
- Navigate to Settings tab
- Add your API keys:
- OpenAI API Key: Required for AI content generation
- Web Scraper API Key: Required for automatic product information extraction
- Choose your preferred scraper service (ScrapingBee, ScraperAPI, or Browserless)
- Click "Save Settings"
Creating a Project
- Go to the Projects tab
- Click "+ New Project"
- Enter:
- Project name
- Product URL (will be auto-scraped for details)
- Optional description
- Click "Create Project"
The extension will automatically scrape your product page and use AI to extract key information.
Generating Content
- Select a project from the Projects tab
- Navigate to the Content tab
- Choose content type (Post or Comment)
- Click "Generate Variations"
- Review and edit the generated variations
- Select your preferred variation
Using Content on Social Media
- Visit any supported platform (Twitter/X, LinkedIn, Reddit, Facebook)
- Navigate to a post or comment form
- Look for the DefPromo auto-fill button near the form
- Click the button to insert your generated content
- The extension automatically tracks this submission in analytics
Tracking Analytics
- Navigate to the Analytics tab
- View comprehensive metrics:
- Total submissions by platform
- Time-series charts
- Platform comparisons
- Best performing content
- A/B testing insights
- Manually update engagement metrics (likes, comments, shares) for tracked content
Export/Import Data
Export:
- Go to Settings tab
- Click "Export All Data"
- Save the JSON file to your preferred location
Import:
- Go to Settings tab
- Click "Import Data"
- Select your previously exported JSON file
- All data will be restored (replaces current data)
Development
Available Scripts
# Start development server pnpm dev # Build for production pnpm build # Run tests pnpm test # Run tests with UI pnpm test:ui # Run tests with coverage pnpm test:coverage # Lint code pnpm lint # Format code pnpm format
Project Structure
defpromo/
├── src/
│ ├── sidebar/ # Content-script sidebar (NEW)
│ │ ├── index.html # Sidebar HTML template
│ │ └── index.jsx # Sidebar entry point
│ ├── sidepanel/ # Main app interface
│ │ ├── App.jsx # Main app component (reused by sidebar)
│ │ ├── views/ # View components
│ │ └── index.jsx # Entry point
│ ├── popup/ # Browser action popup
│ ├── background/ # Background service worker
│ ├── content/ # Content scripts
│ │ ├── sidebar-injector.js # Sidebar injection logic (NEW)
│ │ └── [platform].js # Platform-specific scripts
│ ├── storage/ # IndexedDB layer (Dexie.js)
│ ├── services/ # API services (OpenAI, Scraper)
│ ├── components/ # Shared React components
│ └── styles/ # Global styles
├── public/
│ ├── manifest.json # Extension manifest
│ └── icons/ # Extension icons
├── docs/
│ └── SIDEBAR_ARCHITECTURE.md # Sidebar implementation details
└── dist/ # Build output
For detailed information about the sidebar architecture, see docs/SIDEBAR_ARCHITECTURE.md.
Tech Stack
- Frontend: React 19 + JavaScript (ES2024+)
- Styling: Tailwind CSS v4
- Build Tool: Vite 7
- Database: IndexedDB with Dexie.js
- Testing: Vitest + Testing Library
- Charts: Recharts
- APIs: OpenAI API, Web Scraper APIs
API Requirements
OpenAI API
Get your API key from OpenAI Platform
Web Scraper Services
Choose one:
- ScrapingBee: https://www.scrapingbee.com/ - $49/mo for 100k credits
- ScraperAPI: https://www.scraperapi.com/ - $49/mo for 100k calls
- Browserless: https://www.browserless.io/ - $29/mo for 10k requests
Browser Compatibility
The extension now uses a cross-browser content-script sidebar instead of browser-specific APIs, providing 100% compatibility:
- ✅ Chrome/Chromium (Manifest V3) - Full support
- ✅ Edge (Manifest V3) - Full support
- ✅ Firefox (Manifest V3) - Full support
- ✅ Safari (with Xcode conversion) - Full support
Key Features:
- No platform-specific APIs (
sidePanel,sidebar_action) - Shadow DOM for style isolation
- Resizable sidebar (300-600px)
- Keyboard shortcut:
Ctrl+Shift+S(Windows/Linux) orCmd+Shift+S(Mac) - State persistence across page navigations
Privacy & Security
- All data stored locally in IndexedDB
- No data sent to external servers except user-configured APIs (OpenAI, Web Scraper)
- API keys stored securely in browser storage
- Export files contain sensitive data - handle with care
Contributing
This is a personal project, but suggestions and bug reports are welcome via GitHub issues.
License
ISC
Support
For issues or questions, please open an issue on GitHub.