{"id":31051525,"url":"https://github.com/rzkytmgr/baileysauth","last_synced_at":"2026-04-16T02:31:51.993Z","repository":{"id":308553919,"uuid":"1033214925","full_name":"rzkytmgr/baileysauth","owner":"rzkytmgr","description":"Multiple authentication methods library for the Baileys WhatsApp bot library, supporting both SQL and NoSQL databases.","archived":false,"fork":false,"pushed_at":"2026-04-09T11:40:05.000Z","size":889,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-09T13:25:05.750Z","etag":null,"topics":["authentication","auto","baileys","bot","whatsapp","whatsapp-automation","whatsapp-bot"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/baileysauth","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rzkytmgr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":"rzkytmgr","open_collective":null,"ko_fi":"rzkytmgr","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-08-06T13:22:30.000Z","updated_at":"2026-04-09T11:40:01.000Z","dependencies_parsed_at":"2025-08-06T16:11:47.931Z","dependency_job_id":"43fad764-b41c-4bb3-b406-8cdc8ba48eba","html_url":"https://github.com/rzkytmgr/baileysauth","commit_stats":null,"previous_names":["rzkytmgr/baileys-auth","rzkytmgr/baileysauth"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/rzkytmgr/baileysauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzkytmgr%2Fbaileysauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzkytmgr%2Fbaileysauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzkytmgr%2Fbaileysauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzkytmgr%2Fbaileysauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rzkytmgr","download_url":"https://codeload.github.com/rzkytmgr/baileysauth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rzkytmgr%2Fbaileysauth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31868493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","auto","baileys","bot","whatsapp","whatsapp-automation","whatsapp-bot"],"created_at":"2025-09-15T00:27:35.478Z","updated_at":"2026-04-16T02:31:51.988Z","avatar_url":"https://github.com/rzkytmgr.png","language":"TypeScript","funding_links":["https://patreon.com/rzkytmgr","https://ko-fi.com/rzkytmgr"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cp align=\"center\"\u003eBaileys Auth\u003c/p\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/baileys-v7.0.0--rc.6-x?labelColor=%230bd09f\u0026color=%23f2f5f4\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/baileysauth?label=%20baileysauth\u0026labelColor=%23cdb34c\u0026color=%23f2f5f4\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://img.shields.io/npm/unpacked-size/baileysauth?label=size\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/rzkytmgr/baileysauth/matrix-node-test.yaml\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/v/baileysauth?label=npm%20release\"\u003e\n  \u003cimg src=\"https://img.shields.io/npm/dw/baileysauth\"\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\nLightweight package multiple session and multiple authentication methods for [Baileys](https://github.com/WhiskeySockets/Baileys) whatsapp socket library. Supporting SQL and NoSQL databases.\n\n\u003cdetails open\u003e\n  \u003csummary\u003e\u003cb\u003eTable of Contents\u003c/b\u003e\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003e\n      \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#how-to-use\"\u003eHow to use\u003c/a\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#example-usage\"\u003eExample\u003c/a\u003e\n    \u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n\n## Installation\n\nThis package relies on peer dependencies for database drivers.\nMake sure to install the appropriate driver for your preferred database.  \nSupported databases:\n- MySQL – requires [`mysql2`](https://www.npmjs.com/package/mysql2)\n- PostgreSQL – requires [`pg`](https://www.npmjs.com/package/pg)\n- MongoDB – requires [`mongodb`](https://www.npmjs.com/package/mongodb)\n\n### Example Installation\n\n```bash\n# Using MySQL\nnpm install baileysauth mysql2\n\n# Using PostgreSQL\nnpm install baileysauth pg\n\n# Using MongoDB\nnpm install baileysauth mongodb\n```\nAfter packages installation, now you can import the `useBaileysAuthState` function to your code\n```typescript\nimport useBaileysAuthState from 'baileysauth';\n```\n\n## How to Use\n\nThis package provides two ways to connect to your database using a connection string or using a connection options object,\n### Using a Connection String\nYou can establish a connection by passing a valid connection string directly:\n```typescript\nconst { saveCreds, state } = await useBaileysAuthState(\n  \"mysql://\u003cusername\u003e:\u003cpassword\u003e@localhost:3306/mydatabase\"\n);\n```\n\u003e [!NOTE]\n\u003e Since the release of version `v1.2.0` baileysauth has supported custom table name and session name for connection string connect method. Please check the [example](https://github.com/rzkytmgr/baileysauth/tree/master/example) directory to see how to customize it.\n\n### Using Connection Options\n\nAlternatively, you can use an options object for more flexibility. This method allows you to specify the database driver explicitly using the dialect property and pass driver-specific options through the args property.\n```typescript\nconst { saveCreds, wipeCreds, state } = await useBaileysAuthState({\n  dialect: \"mysql\", // allowed values: mysql, pg, mongodb\n  database: MYSQL_DATABASE,\n  host: MYSQL_HOST,\n  user: MYSQL_USER,\n  password: MYSQL_PASSWORD,\n  port: MYSQL_PORT,\n  session: APP_SESSION,\n  table: APP_STORE,\n  // Driver-specific options (optional)\n  args: {\n    // For MySQL (mysql2)\n    connectionLimit: 10,\n    ssl: { rejectUnauthorized: false },\n  },\n});\n```\n\u003e [!NOTE]\n\u003e The args property should contain valid options specific to the selected dialect. Refer connection options below based on your dialect,\n\u003e - MySQL – [`ConnectionOptionsBase`](https://github.com/rzkytmgr/baileysauth/blob/master/src/Types/index.ts#L29) and [`ConnectionOptions`](https://github.com/sidorares/node-mysql2/blob/master/typings/mysql/lib/Connection.d.ts#L82-L338)\n\u003e - PostgreSQL – [`ConnectionOptionsBase`](https://github.com/rzkytmgr/baileysauth/blob/master/src/Types/index.ts#L29) and [`ClientConfig`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/pg/index.d.ts#L12-L33)\n\u003e - MongoDB – [`MongoDBConnectionOptions`](https://github.com/rzkytmgr/baileysauth/blob/master/src/Types/index.ts#L42) and [`MongoClientOptions`](https://github.com/mongodb/node-mongodb-native/blob/main/src/mongo_client.ts#L141-L318)\n\nIf you are still confused, please ask by [creating an issue](https://github.com/rzkytmgr/baileysauth/issues).\n\n## Example Usage\n\nFor usage examples, you can refer to the example directory. [Check it out!](https://github.com/rzkytmgr/baileysauth/tree/master/example)\n\n## 🧩 Contributing\nIf you have any question or you have an issue when trying to use the package feel free to [create an issue](https://github.com/rzkytmgr/baileysauth/issues) or [make a pull request](https://github.com/rzkytmgr/baileysauth/pulls) to contribute.\n\n---\n\u003csub\u003eMade with ❤️ by \u003ca href=\"https://github.com/rzkytmgr\"\u003eRizky Aulia Tumangger\u003c/a\u003e - Copyright All Rights Reserved © 2025\u003c/sub\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frzkytmgr%2Fbaileysauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frzkytmgr%2Fbaileysauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frzkytmgr%2Fbaileysauth/lists"}