Open pedrorioja opened 8 months ago
`async function initializeClient(user){ const { Client, RemoteAuth } = require('whatsapp-web.js'); const { AwsS3Store } = require('wwebjs-aws-s3'); const { PutObjectCommand, HeadObjectCommand, GetObjectCommand, DeleteObjectCommand } = require('@aws-sdk/client-s3') const s3 = await getS3client() const putObjectCommand = PutObjectCommand; const headObjectCommand = HeadObjectCommand; const getObjectCommand = GetObjectCommand; const deleteObjectCommand = DeleteObjectCommand;
const store = new AwsS3Store({ bucketName: 'YYYYY', remoteDataPath: 'whatsapp/credentials/', s3Client: s3, putObjectCommand, headObjectCommand, getObjectCommand, deleteObjectCommand }); const client = new Client({ authStrategy: new RemoteAuth({ clientId: user, dataPath: `./.${user}`, store: store, backupSyncIntervalMs: 600000 }), puppeteer: { headless: false } }); client.on('qr', (qr) => { console.log('QR RECEIVED', qr); qrcode.generate(qr, { small: true }); }); client.on('ready', async() => { console.log('Client is ready!'); await store.save({session: user}) }); await client.initialize();
`
Hello @pedrorioja, sorry for my late response. Can you give me more details about the errors?
`async function initializeClient(user){ const { Client, RemoteAuth } = require('whatsapp-web.js'); const { AwsS3Store } = require('wwebjs-aws-s3'); const { PutObjectCommand, HeadObjectCommand, GetObjectCommand, DeleteObjectCommand } = require('@aws-sdk/client-s3') const s3 = await getS3client() const putObjectCommand = PutObjectCommand; const headObjectCommand = HeadObjectCommand; const getObjectCommand = GetObjectCommand; const deleteObjectCommand = DeleteObjectCommand;
`