{"id":29745610,"url":"https://github.com/base/account-sdk","last_synced_at":"2026-04-16T00:01:11.666Z","repository":{"id":305712422,"uuid":"1007973241","full_name":"base/account-sdk","owner":"base","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-09T17:23:44.000Z","size":29566,"stargazers_count":128,"open_issues_count":84,"forks_count":140,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-04-09T19:28:44.464Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://base.github.io/account-sdk/","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/base.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","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-06-24T20:29:49.000Z","updated_at":"2026-04-09T17:23:47.000Z","dependencies_parsed_at":"2025-12-16T01:10:33.711Z","dependency_job_id":null,"html_url":"https://github.com/base/account-sdk","commit_stats":null,"previous_names":["base/account-sdk"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/base/account-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Faccount-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Faccount-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Faccount-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Faccount-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/base","download_url":"https://codeload.github.com/base/account-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/base%2Faccount-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31861795,"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":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: 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":[],"created_at":"2025-07-26T06:16:15.787Z","updated_at":"2026-04-16T00:01:11.659Z","avatar_url":"https://github.com/base.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Base Account SDK\n\n[![npm](https://img.shields.io/npm/v/@base-org/account.svg)](https://www.npmjs.com/package/@base-org/account)\n\n## Overview\n\nThe Base Account SDK provides two distinct sets of functionality:\n\n### 1. **Base Pay \u0026 Base Subscriptions** (Standalone Functions)\nPurely functional payment and subscription APIs that work immediately without any SDK setup or wallet connection.\n\n### 2. **Base Account SDK** (Full SDK)\nComplete SDK for connecting to Base Account wallets and interacting with the Ethereum blockchain.\n\n---\n\n## Base Pay - Quick Start\n\n**Base Pay allows you to accept USDC payments with just 3 lines of code.** No SDK instantiation or wallet connection required.\n\n### Installation\n\n```bash\n# npm\nnpm install @base-org/account\n\n# yarn\nyarn add @base-org/account\n```\n\n### Accept a Payment\n\n```typescript\nimport { pay } from '@base-org/account';\n\n// That's it! Just call the pay function directly\nconst payment = await pay({\n  amount: \"10.50\",                                    // Amount in USDC\n  to: \"0xYourWalletAddress\",                         // Your wallet address\n  dataSuffix: \"0xabc123\",                             // Optional attribution data suffix\n  testnet: true                                       // Use testnet for testing\n});\n\nconsole.log(`Payment successful! ID: ${payment.id}`);\n```\n\n### Check Payment Status\n\n```typescript\nimport { getPaymentStatus } from '@base-org/account';\n\nconst status = await getPaymentStatus({\n  id: payment.id,\n  testnet: true\n});\n\nconsole.log(`Payment status: ${status.status}`);\n```\n\n---\n\n## Base Subscriptions - Quick Start\n\n**Base Subscriptions lets you create recurring USDC payments**\n\n### Create a Subscription\n\n```typescript\nimport { subscribe } from '@base-org/account';\n\n// Create a monthly subscription - that's all!\nconst subscription = await subscribe({\n  recurringCharge: \"9.99\",                           // Amount to charge per period\n  subscriptionOwner: \"0xYourAppAddress\",             // Your app's address\n  periodInDays: 30,                                  // Billing period\n  testnet: true                                       // Use testnet for testing\n});\n\nconsole.log(`Subscription created! ID: ${subscription.id}`);\n```\n\n### Check Subscription Status\n\n```typescript\nimport { getSubscriptionStatus } from '@base-org/account';\n\nconst status = await getSubscriptionStatus({\n  id: subscription.id,\n  testnet: true\n});\n\nconsole.log(`Active: ${status.isSubscribed}`);\nconsole.log(`Next charge: ${status.nextPeriodStart}`);\n```\n\n### Charge a Subscription\n\n```typescript\nimport { base } from '@base-org/account';\n\n// Prepare the charge (get the transaction data)\nconst chargeCalls = await base.subscription.prepareCharge({\n  id: subscription.id,\n  amount: '9.99',        // or 'max-remaining-charge'\n  testnet: true\n});\n\n// Execute the charge using your wallet provider\n// (This step requires your app's wallet to execute the transaction)\n```\n\n\n\n## Base Account SDK (Full SDK)\n\nFor applications that need full wallet connectivity and blockchain interactions beyond payments:\n\n1. [Base Account](https://account.base.app)\n   - [Docs](https://docs.base.org/base-account/quickstart/web)\n\n### Installing the SDK\n\n```bash\n# npm\nnpm install @base-org/account\n\n# yarn\nyarn add @base-org/account\n```\n\n### SDK Setup and Usage\n\n\u003e **Note:** The following sections apply only to the full Base Account SDK functionality. For payments and subscriptions, use the standalone functions shown above.\n\n#### Upgrading the SDK\n\n1. Compare the installed version with the latest:\n\n   ```shell\n   # yarn\n   yarn outdated @base-org/account\n\n   # npm\n   npm outdated @base-org/account\n   ```\n\n2. Update to latest:\n\n   ```shell\n   # yarn\n   yarn upgrade @base-org/account --latest\n\n   # npm\n   npm update @base-org/account\n   ```\n\n#### Basic SDK Usage\n\n1. Initialize the SDK\n\n   ```js\n   const sdk = createBaseAccountSDK({\n     appName: 'SDK Playground',\n   });\n   ```\n\n2. Make Base Account Provider\n\n   ```js\n   const provider = sdk.getProvider();\n   ```\n\n3. Request accounts to initialize a connection to wallet\n\n   ```js\n   const addresses = provider.request({\n     method: 'eth_requestAccounts',\n   });\n   ```\n\n4. Make more requests\n\n   ```js\n   provider.request('personal_sign', [\n     `0x${Buffer.from('test message', 'utf8').toString('hex')}`,\n     addresses[0],\n   ]);\n   ```\n\n5. Handle provider events\n\n   ```js\n   provider.on('connect', (info) =\u003e {\n     setConnect(info);\n   });\n\n   provider.on('disconnect', (error) =\u003e {\n     setDisconnect({ code: error.code, message: error.message });\n   });\n\n   provider.on('accountsChanged', (accounts) =\u003e {\n     setAccountsChanged(accounts);\n   });\n\n   provider.on('chainChanged', (chainId) =\u003e {\n     setChainChanged(chainId);\n   });\n\n   provider.on('message', (message) =\u003e {\n     setMessage(message);\n   });\n   ```\n\n### Developing locally and running the test app\n\n- The Base Account SDK test app can be viewed here https://base.github.io/account-sdk/.\n- To run it locally follow these steps:\n\n  1. Fork this repo and clone it\n  1. From the root dir run `yarn install`\n  1. From the root dir run `yarn dev`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase%2Faccount-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbase%2Faccount-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbase%2Faccount-sdk/lists"}