mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-17 19:26:20 +00:00
Auth Strategies (#1257)
* auth strategies * default to no auth * rename base auth strategy * rename base strategy cont. * refactor auth strategy methods and LocalAuth * activate old session options even if is falsy value * move restartOnAuthFail to LegacyAuthStrategy option * add link to guide item * update example/shell * types
This commit is contained in:
13
example.js
13
example.js
@@ -1,17 +1,10 @@
|
||||
const { Client, Location, List, Buttons } = require('./index');
|
||||
const { Client, Location, List, Buttons, LocalAuth } = require('./index');
|
||||
|
||||
const client = new Client({
|
||||
clientId: 'example',
|
||||
const client = new Client({
|
||||
authStrategy: new LocalAuth(),
|
||||
puppeteer: { headless: false }
|
||||
});
|
||||
|
||||
// You also could connect to an existing instance of a browser
|
||||
// {
|
||||
// puppeteer: {
|
||||
// browserWSEndpoint: `ws://localhost:3000`
|
||||
// }
|
||||
// }
|
||||
|
||||
client.initialize();
|
||||
|
||||
client.on('qr', (qr) => {
|
||||
|
||||
Reference in New Issue
Block a user