import "dotenv/config"; import path from "node:path"; import { chromium } from "playwright"; // Run interactively before starting the PM2 worker. Never share your everyday Chrome profile. const context = await chromium.launchPersistentContext(path.resolve(process.env.CHATGPT_PROFILE_DIR || ".data/chatgpt-profile"), { channel: process.env.CHATGPT_BROWSER_CHANNEL || "chrome", headless: false, }); const page = await context.newPage(); await page.goto("https://chatgpt.com/"); console.log("Log in to ChatGPT, then close the browser. Start the worker afterward."); await new Promise((resolve) => context.once("close", resolve));