Coder Social home page Coder Social logo

arbisyarifudin / wwebjs-aws-s3 Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 3.0 27 KB

A remote authentication plugin for whatsapp-web.js. Use the AWS S3 to keep your WhatsApp MultiDevice session data safe and secure.

License: MIT License

JavaScript 100.00%
aws aws-s3 whatsapp whatsapp-web-js

wwebjs-aws-s3's Introduction

Hi there ๐Ÿ‘‹

I am a full-stack developer who loves the intersection between the art of programming and design.

  • ๐Ÿ”ญ Currently involved in the development of Satuin.id as a Lead Developer (Remote)
  • ๐Ÿ’ป My expertise includes Laravel / Lumen, Node Js, Vue Js, Quasar Framework, Nuxt Js & PostgreSQL
  • ๐ŸŒฑ I am currently expanding my knowledge in AWS Cloud & DevOps
  • ๐Ÿ‘จโ€๐Ÿ’ป Open to remote job opportunities, while also keen on collaborating on personal projects.
  • ๐Ÿ’ฌ Ask me about: web development, mobile-hybrid apps development, rest API, database design, etc
  • ๐Ÿ“ซ Reach me on: Telegram

stats graph languages graph

javascript logo html5 logo css3 logo vue logo nuxtjs logo laravel logo nodejs logo postgresql logo jira logo

profile views

wwebjs-aws-s3's People

Contributors

arbisyarifudin avatar pedrorioja avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

wwebjs-aws-s3's Issues

Not loading session from remote

After a succesfull login, the zip file is saved on my S3.

When I restart my app, I can see the session file is downloaded from S3, but the whatsapp client is not logged, it keep asking for the QR Code.

2024-01-24T12:54:55.665Z [STORE_DEBUG] [METHOD: sessionExists] Triggered.
2024-01-24T12:54:56.067Z [STORE_DEBUG] [METHOD: sessionExists] File found. PATH='active/RemoteAuth-my-session.zip'.
2024-01-24T12:54:56.240Z [STORE_DEBUG] [METHOD: extract] Triggered.
2024-01-24T12:54:57.558Z [STORE_DEBUG] [METHOD: extract] File extracted. REMOTE_PATH='active/RemoteAuth-my-session.zip', LOCAL_PATH='RemoteAuth-my-session.zip'.

Is there anything missing to use the session saved in the bucket?

Cant extract instance clients

While accesing the extract function, i am getting the following error:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined

I have added some logs to see the value of the session passed and the type of the remotePath variable and i get the correct values

2024-02-07T22:36:30.831Z [STORE_DEBUG] /RemoteAuth-a5eac9c5-5b51-4f02-9bcf-439e0bd59cc1
2024-02-07T22:36:30.831Z [STORE_DEBUG] string

I am trying to understand what is happening.

Error when trying to save remote session

`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();

`

image

Empty zip is being uploaded

Reprocedure: I am currently following your example.
But after running, only empty folder is being uploaded (folder name: Default inside this zip file)
I am running on Windows, Node 18
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.