76e080daec
Adds a new async function that automatically fetches the latest
WhatsApp Web version from web.whatsapp.com before connecting.
Usage:
```typescript
// Option 1: Auto-fetch version (recommended)
const sock = await makeWASocketAutoVersion({ auth: state })
// Option 2: Manual version (existing behavior)
const sock = makeWASocket({ auth: state })
```
Benefits:
- No need to update library for version changes
- Automatic fallback to bundled version if fetch fails
- Logged warnings when using fallback
14 lines
427 B
TypeScript
14 lines
427 B
TypeScript
import makeWASocket, { makeWASocketAutoVersion } from './Socket/index'
|
|
|
|
export * from '../WAProto/index.js'
|
|
export * from './Utils/index'
|
|
export * from './Types/index'
|
|
export * from './Defaults/index'
|
|
export * from './WABinary/index'
|
|
export * from './WAM/index'
|
|
export * from './WAUSync/index'
|
|
|
|
export type WASocket = ReturnType<typeof makeWASocket>
|
|
export { makeWASocket, makeWASocketAutoVersion }
|
|
export default makeWASocket
|