@ochui/wwebjs-s3
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

wwebjs-s3

An S3 plugin for whatsapp-web.js!

Use S3 bucket to save your WhatsApp MultiDevice session on a S3 Bucket.

Quick Links

Installation

npm i @ochui/wwebjs-s3 or yarn add @ochui/wwebjs-s3

Example usage

const { Client, RemoteAuth } = require('whatsapp-web.js');
const { S3Client } = require("@aws-sdk/client-s3");
const { S3Store }  = require('@ochui/wwebjs-s3');



const s3 = new S3Client({
    region: 'us-east-2',
    credentials: {
        accessKeyId: process.env.AWS_ACCESS_KEY_ID,
        secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
    }
})
const store = new S3Store({ 
    s3: s3, 
    bucketName: 'YOUR_BUCKET_NAME',
    sessionPath: 'path/to/your/session' // Optional
});

const client = new Client({
    authStrategy: new RemoteAuth({
        store: store,
        backupSyncIntervalMs: 300000
    })
});

client.initialize();

Delete Remote Session

How to force delete a specific remote session on the Database:

await store.delete({session: 'yourSessionName'});

Package Sidebar

Install

npm i @ochui/wwebjs-s3

Weekly Downloads

2

Version

1.0.3

License

ISC

Unpacked Size

4.79 kB

Total Files

5

Last publish

Collaborators

  • ochui