{"id":23409042,"url":"https://github.com/developerwilliams/mini-daraja","last_synced_at":"2025-04-09T01:41:44.732Z","repository":{"id":268377584,"uuid":"904138867","full_name":"DeveloperWilliams/mini-daraja","owner":"DeveloperWilliams","description":"Mini-Daraja is a lightweight Node.js library for seamless integration with the Safaricom Daraja API. It simplifies handling M-Pesa operations like STK Push, B2C, C2B, transaction status, and balance inquiries, with modern ES6 module support and robust error handling","archived":false,"fork":false,"pushed_at":"2025-01-25T22:15:53.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T19:53:35.336Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/DeveloperWilliams.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2024-12-16T10:21:38.000Z","updated_at":"2025-01-25T22:15:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a492a8f-190f-4a8e-a5ad-896f00423049","html_url":"https://github.com/DeveloperWilliams/mini-daraja","commit_stats":null,"previous_names":["developerwilliams/mini-daraja"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeveloperWilliams%2Fmini-daraja","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeveloperWilliams%2Fmini-daraja/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeveloperWilliams%2Fmini-daraja/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeveloperWilliams%2Fmini-daraja/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeveloperWilliams","download_url":"https://codeload.github.com/DeveloperWilliams/mini-daraja/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247958710,"owners_count":21024821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-22T15:19:56.868Z","updated_at":"2025-04-09T01:41:44.715Z","avatar_url":"https://github.com/DeveloperWilliams.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Mini-Daraja**\n**Seamless M-Pesa Integration for Node.js**\n\nMini-Daraja is the most popular and widely used Node.js library for seamless integration with the Safaricom Daraja API. It simplifies handling M-Pesa operations like STK Push, B2C, C2B, transaction status, and balance inquiries, with modern ES6 module support and robust error handling.\n\n---\n\n## **Features**\n- 🚀 Simple and clean API to integrate M-Pesa operations\n- 🔒 Modern ES6+ module support\n- ⚙️ Handles STK Push, B2C, C2B, Transaction Status, and Balance Inquiries\n- 🛡️ Robust error handling with clear error messages  \n\n---\n\n## Installation\n\nTo install, run:\n\n```bash\nnpm install mini-daraja\n```\n\n---\n\n## Usage\n\n##### Usage example for Initialize Daraja API instance with credentials\n\n```javascript\nimport mpesa from 'mini-daraja';\n\n// Initialize Daraja API instance with credentials\nconst daraja = mpesa({\n  consumerKey: 'your_consumer_key',        // Replace with your Consumer Key\n  consumerSecret: 'your_consumer_secret',  // Replace with your Consumer Secret\n  shortCode: '174379',                     // Replace with your M-Pesa Shortcode\n  passKey: 'your_pass_key_here',           // Replace with your PassKey\n  callbackUrl: 'https://example.com/callback', // Replace with your Callback URL\n});\n```\n##### STK Push Example\n```javascript\n // Function to perform STK Push\nasync function stkPush() {\n  try {\n    const response = await daraja.stkPush({\n      phoneNumber: '254708966189',           // Customer's phone number (E.164 format)\n      amount: 100,                          // Transaction amount\n      accountReference: 'Invoice123',        // Custom account reference\n      transactionDescription: 'Test Payment', // Transaction description\n    });\n    console.log('✅ STK Push Response:', response);\n  } catch (error) {\n    console.error('❌ STK Push Error:', error.message);\n  }\n}\n```\n\n## Contact\n\nDesigned by *William Achuchi Wanyama*\n - Email: [archywilliams2@gmail.com](mailto:archywilliams2@gmail.com)\n - X: [@dev_williee](https://x.com/dev_williee)\n - LinkedIn: [William Achuchi Wanyama](https://linkedin.com/in/achuchi)\n\n\n            ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperwilliams%2Fmini-daraja","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperwilliams%2Fmini-daraja","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperwilliams%2Fmini-daraja/lists"}