Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Kismetkanceled/geniehelper/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The GenieHelper Cookie Capture browser extension enables seamless authentication with creator platforms by capturing and storing session cookies. This eliminates the need for repeatedly entering credentials and enables automated scraping and publishing workflows.
The extension supports cookie capture for 9 creator platforms:
- OnlyFans
- Fansly
- Pornhub
- XVideos
- Instagram
- TikTok
- X (Twitter)
- Reddit
- YouTube
How It Works
Cookie Capture Flow
- Navigate to Platform: Log in to any supported platform in your browser
- Open Extension: Click the GenieHelper extension icon
- Capture Cookies: The extension detects the current platform and captures all session cookies
- Secure Storage: Cookies are encrypted with AES-256-GCM and stored in the
platform_sessions collection
- Agent Reuse: Stagehand browser sessions can now inject these cookies to bypass login
Extension Components
Manifest (MV3)
The extension uses Manifest V3 with the following permissions:
cookies: Read platform session cookies
activeTab: Detect current platform from active tab
storage: Store configuration (server URL, Directus token, creator profile ID)
Background Service Worker
Location: /home/daytona/workspace/source/extension/background.js:1
Handles two message types:
CAPTURE_COOKIES: Collects cookies for detected platform and POSTs to /api/credentials/store-platform-session
GET_CURRENT_TAB: Returns current tab URL and detected platform
Platform Detection:
const PLATFORM_DOMAINS = {
onlyfans: ["onlyfans.com"],
fansly: ["fansly.com"],
pornhub: ["pornhub.com"],
// ... 9 platforms total
};
Location: /home/daytona/workspace/source/extension/popup.js:1
Provides:
- Platform Detection Indicator: Shows detected platform with colored dot
- Capture Button: Triggers cookie capture (disabled if not configured)
- Settings Link: Opens options page for configuration
- Status Messages: Real-time feedback during capture process
Configuration
Extension Options
The extension requires three configuration values stored in chrome.storage.sync:
| Field | Description |
|---|
serverUrl | Your GenieHelper server URL (e.g., https://geniehelper.com) |
directusToken | Directus authentication token for API access |
creatorProfileId | The ID of the creator_profiles record to associate cookies with |
First-Time Setup
- Install the extension from Chrome Web Store or Firefox Add-ons
- Right-click extension icon → Options
- Enter your server URL, Directus token, and creator profile ID
- Navigate to a supported platform and log in
- Click extension icon → “Capture Cookies”
HITL (Human-in-the-Loop) Sessions
What is HITL?
HITL sessions are triggered when automated scraping fails due to missing or expired cookies. Instead of failing silently, Genie Helper creates a HITL session request that alerts you to log in manually.
HITL Flow
- Scrape Attempt: User clicks “Scrape Profile” in dashboard
- Cookie Check: System checks
platform_sessions for valid cookies
- HITL Trigger: If no valid session exists, creates
hitl_sessions record
- Dashboard Alert: Yellow banner appears: “Login Required: [Platform]”
- User Action: User clicks banner → opens platform in new tab → logs in → captures cookies via extension
- Session Update:
hitl_sessions.status changes from pending → completed
- Auto-Retry: Original scrape job automatically resumes with fresh cookies
HITL Sessions Collection
Collection: hitl_sessions
| Field | Type | Description |
|---|
id | UUID | Session identifier |
creator_profile_id | M2O | Link to creator profile |
platform | String | Platform requiring login (e.g., “onlyfans”) |
status | String | pending, completed, expired, failed |
requested_at | Timestamp | When HITL was triggered |
completed_at | Timestamp | When user completed login |
notes | Text | Error details or user notes |
Dashboard Integration
The dashboard polls for pending HITL sessions:
Dashboard Banner Logic:
// Check for pending HITL sessions
const response = await api.get('/api/directus/items/hitl_sessions', {
params: {
filter: { status: { _eq: 'pending' } },
fields: ['id', 'platform', 'requested_at']
}
});
if (response.data.data.length > 0) {
// Show yellow alert banner
showHITLAlert(response.data.data[0]);
}
Cookie Storage & Security
Collection: platform_sessions
| Field | Type | Description |
|---|
id | UUID | Session identifier |
creator_profile_id | M2O | Creator profile this session belongs to |
platform | String | Platform name (e.g., “onlyfans”) |
cookies | JSON | Encrypted cookie array |
user_agent | String | Browser user agent (for Stagehand reuse) |
captured_at | Timestamp | When cookies were captured |
expires_at | Timestamp | Estimated expiration (90 days default) |
last_used_at | Timestamp | Last time cookies were injected into Stagehand |
Encryption
All cookies are encrypted server-side using AES-256-GCM before storage.
Encryption Location: /home/daytona/workspace/source/server/utils/credentialsCrypto.js:1
Envelope Format:
v1:<iv_b64>:<tag_b64>:<ciphertext_b64>
Example Storage:
{
"enc": "v1:k8sQn2F...base64_iv:xR9pL...base64_tag:mZ3cV...base64_ciphertext"
}
Environment Variables:
CREDENTIALS_ENC_KEY_B64: Base64-encoded 32-byte encryption key
CREDENTIALS_ENC_AAD: Optional additional authenticated data (default: “agentx-v1”)
Cookie Normalization
Before encryption, cookies are normalized to remove Chrome-internal fields:
Extension Normalization (background.js:94):
const normalized = allCookies.map((c) => ({
name: c.name,
value: c.value,
domain: c.domain,
path: c.path,
secure: c.secure,
httpOnly: c.httpOnly,
sameSite: c.sameSite,
expirationDate: c.expirationDate,
}));
Stagehand Cookie Injection
Once captured, cookies are injected into Stagehand browser sessions for automated workflows.
Injection Flow
- Fetch Session: Retrieve latest
platform_sessions record for platform
- Decrypt Cookies: Call
decryptJSON(session.cookies)
- Start Stagehand: Initialize browser session via Stagehand MCP
- Inject Cookies: Call
set-cookies tool with decrypted cookie array
- Navigate: Load platform URL with authenticated session
- Extract Data: Scrape profile stats, posts, earnings, etc.
Action Runner Step (stepExecutors.js:222):
async stagehand_cookie_login(config, signal) {
const { creator_profile_id, platform } = config;
// 1. Fetch encrypted cookies from Directus
const session = await directusFetch(
`/items/platform_sessions?filter[creator_profile_id]=${creator_profile_id}&filter[platform]=${platform}&limit=1`
);
// 2. Start Stagehand session
const startRes = await stagehandFetch("/v1/sessions/start", { /* ... */ });
const sessionId = startRes.sessionId;
// 3. Inject cookies
await stagehandFetch(`/v1/sessions/${sessionId}/cookies`, { cookies });
// 4. Navigate to platform
await stagehandFetch(`/v1/sessions/${sessionId}/navigate`, { url: targetUrl });
return { sessionId };
}
Extension Development
File Structure
extension/
├── manifest.json # Chrome/Edge manifest (MV3)
├── manifest.firefox.json # Firefox manifest (MV3)
├── background.js # Service worker (message handlers)
├── popup.html # Extension popup UI
├── popup.js # Popup logic + platform detection
├── options.html # Configuration page
├── options.js # Settings persistence
└── icons/
├── icon16.png
├── icon48.png
└── icon128.png
Building for Distribution
Chrome Web Store:
- Zip entire
extension/ directory (exclude .firefox.json)
- Upload to Chrome Developer Dashboard
- Submit privacy policy (required for
cookies permission)
Firefox Add-ons:
- Rename
manifest.firefox.json → manifest.json
- Zip directory
- Upload to Firefox Add-on Developer Hub
Privacy Policy
The extension must include a privacy policy due to cookie permissions:
Key Points:
- Cookies are only captured on user action (button click)
- Cookies are sent only to user’s configured GenieHelper server
- No third-party tracking or analytics
- All data encrypted server-side with AES-256-GCM
Troubleshooting
If extension shows “Not Configured” banner:
- Open extension options (right-click icon → Options)
- Verify server URL includes
https:// and no trailing slash
- Confirm Directus token is valid (test in dashboard)
- Ensure creator profile ID exists in
creator_profiles collection
”No Cookies Found” Error
If capture fails with no cookies:
- Confirm you’re logged into the platform
- Check platform is in supported list
- Clear browser cookies and re-login
- Try capturing immediately after login
”Server Error 401” Error
If API returns 401 Unauthorized:
- Directus token may be expired or invalid
- Regenerate token in Directus admin panel
- Update extension options with new token
HITL Session Stuck in “Pending”
If HITL session doesn’t complete:
- Manually update
hitl_sessions status to completed in Directus
- Verify
platform_sessions record was created
- Check
captured_at timestamp is recent
- Re-trigger scrape job from dashboard