The create() function accepts an options object to control the browser, session, logging, and connection settings.
Key Configuration Groups:
- Browser:
headless, devtools, browserWS, browserPathExecutable, puppeteerOptions, browserArgs, addBrowserArgs. - Session:
folderNameToken, mkdirFolderToken, createPathFileToken. - Logging:
debug, logQR, updatesLog, disableSpins, disableWelcome. - Connection:
autoClose, addProxy, userProxy, userPass.
You can also provide a browserInstance callback to access the Puppeteer browser and page objects directly.
create({
session: 'production',
catchQR: (base64Qr, asciiQR, attempts, urlCode) => {
console.log(`Scan attempt ${attempts}`);
},
statusFind: (status, session) => {
console.log(`[${session}] Status: ${status}`);
},
options: {
// Browser
headless: 'new',
devtools: false,
browserWS: '',
browserPathExecutable: '',
puppeteerOptions: {},
browserArgs: [''],
addBrowserArgs: [''],
// Session
folderNameToken: 'tokens',
mkdirFolderToken: '',
createPathFileToken: false,
// Logging
debug: false,
logQR: true,
updatesLog: true,
disableSpins: false,
disableWelcome: false,
// Connection
autoClose: 60000,
addProxy: [''],
userProxy: '',
userPass: ''
},
browserInstance: (browser, waPage) => {
console.log('Browser PID:', browser.process().pid);
}
});