{"_id":"@abdulmuiz44/clientpad-sdk","_rev":"2-aa65518b5e0e5a428a2d68c866d7a39f","name":"@abdulmuiz44/clientpad-sdk","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@abdulmuiz44/clientpad-sdk","version":"0.1.0","keywords":["clientpad","sdk","business-infrastructure","api-client","typescript","open-source"],"license":"MIT","_id":"@abdulmuiz44/clientpad-sdk@0.1.0","maintainers":[{"name":"abdulmuiz44","email":"abdulmuizproject@gmail.com"}],"dist":{"shasum":"23b21097587b0f9d5386b2e6cff9f4ada77af21b","tarball":"https://registry.npmjs.org/@abdulmuiz44/clientpad-sdk/-/clientpad-sdk-0.1.0.tgz","fileCount":6,"integrity":"sha512-Pg+Kq9bM+rqLNirpeEZkMLqOXV4ogMWmn9ZebBIs/uFoCQUewxriyZrPYfCINqP1/b/zgFNbMSgTMWcaj21TYQ==","signatures":[{"sig":"MEQCIBMp6dvu7Ue2R1/3S4HHSfHrOLyreSo+QLuMuMmKtGeGAiAX5Yv+m/d5tJbvUP2EyYKF6Q5m5pZzHOOoBXi5Dwq4Lg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17193},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","engines":{"node":">=18"},"gitHead":"5bea15f12b556946d96cdf84530c119525df300b","scripts":{"test":"npm run build && node test/sdk.test.mjs","build":"tsc -p tsconfig.json","prepack":"npm run build","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"abdulmuiz44","email":"abdulmuizproject@gmail.com"},"_npmVersion":"10.9.3","description":"TypeScript SDK for ClientPad public APIs.","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/clientpad-sdk_0.1.0_1778249474763_0.1418372258574998","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@abdulmuiz44/clientpad-sdk","version":"0.2.0","description":"TypeScript SDK for ClientPad public APIs.","license":"MIT","type":"module","main":"dist/index.js","types":"dist/index.d.ts","keywords":["clientpad","sdk","business-infrastructure","api-client","typescript","open-source"],"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"npm run build && node test/sdk.test.mjs","prepack":"npm run build"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"_id":"@abdulmuiz44/clientpad-sdk@0.2.0","gitHead":"f2d5f2e2cfc05cc89b2dc516f675f50b140bba80","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-cHmiztmNFU0lvxiuTkNREPE01ruD3rDikxwx7kauTXxQvqQ+VUhpumhZcJo5iZ7qdQ08iYSdWzPVzNovWmNNlQ==","shasum":"fabf1db1a0988f74511e3b29473101258c9fb71a","tarball":"https://registry.npmjs.org/@abdulmuiz44/clientpad-sdk/-/clientpad-sdk-0.2.0.tgz","fileCount":6,"unpackedSize":19053,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCBl9PpTJmhflSbxfo3D4TLerFc4MebPcJncrS9Vda3KwIhAMWL1V0W0xVk8mPZbPm7e7wEilgWOnyw3ioKXZ08xVLJ"}]},"_npmUser":{"name":"abdulmuiz44","email":"abdulmuizproject@gmail.com"},"directories":{},"maintainers":[{"name":"abdulmuiz44","email":"abdulmuizproject@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/clientpad-sdk_0.2.0_1778252452555_0.6650210148087954"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-08T14:11:14.614Z","modified":"2026-05-08T15:00:52.824Z","0.1.0":"2026-05-08T14:11:14.919Z","0.2.0":"2026-05-08T15:00:52.698Z"},"license":"MIT","keywords":["clientpad","sdk","business-infrastructure","api-client","typescript","open-source"],"description":"TypeScript SDK for ClientPad public APIs.","maintainers":[{"name":"abdulmuiz44","email":"abdulmuizproject@gmail.com"}],"readme":"# ClientPad SDK\n\nTypeScript SDK for ClientPad's public API.\n\n## Install\n\n```bash\npnpm add @abdulmuiz44/clientpad-sdk\n```\n\n## Basic Usage\n\nExpose APIs with `@abdulmuiz44/clientpad-server`, then consume them with this SDK.\n\n```ts\nimport { ClientPad } from \"@abdulmuiz44/clientpad-sdk\";\n\nconst clientpad = new ClientPad({\n  baseUrl: \"https://example.com/api/public/v1\",\n  apiKey: process.env.CLIENTPAD_API_KEY!,\n});\n\nawait clientpad.leads.create({\n  name: \"Ada Customer\",\n  phone: \"+234...\",\n  source: \"WhatsApp\",\n});\n```\n\n## Node\n\n```ts\nconst leads = await clientpad.leads.list({\n  limit: 50,\n  offset: 0,\n  status: \"new\",\n});\n```\n\n## Next.js Route Handler\n\n```ts\nimport { ClientPad } from \"@abdulmuiz44/clientpad-sdk\";\n\nconst clientpad = new ClientPad({\n  baseUrl: process.env.CLIENTPAD_API_URL!,\n  apiKey: process.env.CLIENTPAD_API_KEY!,\n});\n\nexport async function POST() {\n  const result = await clientpad.clients.create({\n    business_name: \"Ada Ventures\",\n    primary_contact: \"Ada Customer\",\n  });\n\n  return Response.json(result);\n}\n```\n\n## Express\n\n```ts\napp.post(\"/lead\", async (_req, res, next) => {\n  try {\n    const result = await clientpad.leads.create({\n      name: \"Ada Customer\",\n      phone: \"+234...\",\n    });\n    res.json(result);\n  } catch (error) {\n    next(error);\n  }\n});\n```\n\n## Usage\n\nHosted ClientPad Cloud keys can expose quota and rate-limit usage:\n\n```ts\nconst usage = await clientpad.usage.retrieve();\n\nconsole.log(usage.data.request_count);\nconsole.log(usage.data.remaining_requests);\n```\n\n## Error Handling\n\n```ts\nimport { ClientPadError } from \"@abdulmuiz44/clientpad-sdk\";\n\ntry {\n  await clientpad.leads.list();\n} catch (error) {\n  if (error instanceof ClientPadError) {\n    console.error(error.status, error.payload);\n  }\n}\n```\n\n## Custom Fetch\n\n```ts\nconst clientpad = new ClientPad({\n  baseUrl: \"https://example.com/api/public/v1\",\n  apiKey: \"cp_test_...\",\n  fetch: customFetch,\n});\n```\n","readmeFilename":"README.md"}