{"id":49093661,"url":"https://github.com/rithvikvibhu/upi.js","last_synced_at":"2026-04-20T19:35:02.006Z","repository":{"id":333193865,"uuid":"1042462419","full_name":"rithvikvibhu/upi.js","owner":"rithvikvibhu","description":"A collection of tools to help integrate UPI.","archived":false,"fork":false,"pushed_at":"2026-01-17T21:04:59.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-18T07:52:31.045Z","etag":null,"topics":["bun","library","payments","typescript","upi"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rithvikvibhu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-08-22T04:05:39.000Z","updated_at":"2026-01-18T05:38:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rithvikvibhu/upi.js","commit_stats":null,"previous_names":["rithvikvibhu/upi.js"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rithvikvibhu/upi.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithvikvibhu%2Fupi.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithvikvibhu%2Fupi.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithvikvibhu%2Fupi.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithvikvibhu%2Fupi.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rithvikvibhu","download_url":"https://codeload.github.com/rithvikvibhu/upi.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rithvikvibhu%2Fupi.js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bun","library","payments","typescript","upi"],"created_at":"2026-04-20T19:34:57.259Z","updated_at":"2026-04-20T19:35:01.990Z","avatar_url":"https://github.com/rithvikvibhu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# upi.js\n\nA collection of tools to help integrate UPI.\n\n## UPI Lib\n\nThis is a library that provides a common interface to perform UPI operations, backed by pluggable PSPs (Payment Service Providers).\n\n\u003e For the sake of simplicity, 3rd party apps are also considered PSPs.\n\nCan be used to:\n\n- Login to PSP accounts\n- View linked bank accounts\n- Pay\n- Collect\n\n\u003e [!NOTE]\n\u003e This package aims to be an entry point for integrating UPI in general. If you're looking for CommonLibrary specifically, [52-1ab](https://52-1ab.github.io/) has published an independent implementation of it written in Go, with bindings for many languages. Check it out [here](https://github.com/52-1ab/cl)!\n\n## Install\n\n```sh\nbun add upi.js\n```\n\n## Usage\n\nStart with:\n\n```ts\n// Use one of the PSPs (or bring your own)\nimport { MockPsp } from 'upi.js/psps';\nconst pspClient = new MockPsp();\n\n// Use one of the stores (or bring your own)\nimport { JSONFileStore } from 'upi.js/stores';\nconst store = new JSONFileStore();\n\n// Initialize the library\nconst lib = new UPILib(store, pspClient);\nawait lib.init();\n\n// (optional) for methods that require pin:\nlib.pin = '1234'; // or a function that returns pin\n```\n\nThen call its methods:\n\n```ts\n// Get Accounts\nconst accounts = await lib.getAccounts();\nconst account = accounts[0];\n\n// Get Balance\nconst balance = await lib.getBalance(account);\n// returns: '12.00'\n\n// Lookup VPA\nawait lib.lookupVPA('foo@hdfcbank');\n// returns: {found: true, name: 'Full Name'}\n\n// Pay\nawait lib.payVPA(account, 'foo@hdfcbank', {\n  currency: 'INR',\n  value: '15.00',\n});\n\n// Collect\nawait lib.collectVPA(account, {\n  vpa: 'foo@hdfcbank',\n  amount: { currency: 'INR', value: '15.00' },\n  expiry: new Date(+new Date() + 1000 * 3600 * 1), // 1hr in future\n  note: 'for pizza',\n});\n```\n\nTo install dependencies:\n\n```bash\nbun install\n```\n\n\u003c!-- CLI:\n```bash\nbun bin/run.js\n``` --\u003e\n\n## Writing PSP Clients\n\nTo write a PSP client, you need to implement the `PSPClient` interface in [src/types.d.ts](src/types.d.ts).\n\nFor an example, see the [MockPSP](src/psps/mock/index.ts) implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frithvikvibhu%2Fupi.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frithvikvibhu%2Fupi.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frithvikvibhu%2Fupi.js/lists"}