{"_id":"@dollardonationclub/impactapi-js","_rev":"8-7ca6ece585036df5b0fc86e9cd46083b","name":"@dollardonationclub/impactapi-js","dist-tags":{"latest":"0.5.1"},"versions":{"0.1.0":{"name":"@dollardonationclub/impactapi-js","version":"0.1.0","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"author":{"name":"Dollar Donation Club"},"license":"MIT","_id":"@dollardonationclub/impactapi-js@0.1.0","maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"homepage":"https://github.com/Dollar-Donation-Club/impactapi-sdk#readme","bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-sdk/issues"},"dist":{"shasum":"d33ba0d686e033a381f9bdc885ec4092b3968563","tarball":"https://registry.npmjs.org/@dollardonationclub/impactapi-js/-/impactapi-js-0.1.0.tgz","fileCount":6,"integrity":"sha512-4IHeazOQxFQPJ6GSd5coiafmvduhY+L6pUO8bZJhheQ8XTEsE1hQjgtkKoS7b+/1zEThF6wp+T6zrd/3qbuBog==","signatures":[{"sig":"MEUCIQC2zbPiBNgXk8nDH6z2qr9b9Ax8Ys8UpcW1Lj44fziw+QIgP8aOyKjC9gvsMnUmW3H1Mhiw9aqlxt61ThSEofF8XXY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":67503},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"85e5640f7274835398fc57b928c2c43f9a78b603","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","clean":"rm -rf dist","lint:fix":"eslint . --fix","type-check":"tsc --noEmit","prepublishOnly":"pnpm run build:production","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"},"repository":{"url":"git+https://github.com/Dollar-Donation-Club/impactapi-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"JavaScript SDK for integrating the DDC Impact Widget into any website","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.0","dotenv":"17.2.3","eslint":"9.36.0","globals":"16.4.0","prettier":"3.6.2","@eslint/js":"9.36.0","typescript":"^5.9.2","@ddc/shared":"workspace:*","@types/node":"^22.18.6","typescript-eslint":"8.44.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/impactapi-js_0.1.0_1760456968137_0.4363880838243872","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dollardonationclub/impactapi-js","version":"0.1.1","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"author":{"name":"Dollar Donation Club"},"license":"MIT","_id":"@dollardonationclub/impactapi-js@0.1.1","maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"homepage":"https://github.com/Dollar-Donation-Club/impactapi-sdk#readme","bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-sdk/issues"},"dist":{"shasum":"f84ffc1b8624021cf703e7a57b81cf32013b4dc1","tarball":"https://registry.npmjs.org/@dollardonationclub/impactapi-js/-/impactapi-js-0.1.1.tgz","fileCount":6,"integrity":"sha512-jrQE77kkadEQRuT4Igqj92EjQ+EheDl9eDsBa9UTq2Wy6sCLpLsC4W4CoA6rtrkgRckXSD9OfFZ7otTl8vXqWg==","signatures":[{"sig":"MEUCICBHFSXMjdsQErATGrnnQQLJNYFvrR6P8RXkHQ4CjxzfAiEAlUEAJrO+pmxH78n8hVKKzGphe1Sh117k+DIuxtPxIlA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":68436},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"27205d06a5a9816d3ef0713d9d3a5825fabf9516","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","clean":"rm -rf dist","lint:fix":"eslint . --fix","type-check":"tsc --noEmit","prepublishOnly":"pnpm run build:production","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"},"repository":{"url":"git+https://github.com/Dollar-Donation-Club/impactapi-sdk.git","type":"git"},"_npmVersion":"10.9.2","description":"JavaScript SDK for integrating the DDC Impact Widget into any website","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.0","dotenv":"17.2.3","eslint":"9.36.0","globals":"16.4.0","prettier":"3.6.2","@eslint/js":"9.36.0","typescript":"^5.9.2","@ddc/shared":"workspace:*","@types/node":"^22.18.6","typescript-eslint":"8.44.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/impactapi-js_0.1.1_1760642097581_0.786719093736095","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@dollardonationclub/impactapi-js","version":"0.2.0","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"author":{"name":"Dollar Donation Club"},"license":"MIT","_id":"@dollardonationclub/impactapi-js@0.2.0","maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"homepage":"https://github.com/Dollar-Donation-Club/impactapi-sdk#readme","bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-sdk/issues"},"dist":{"shasum":"94c8b44c8396eaa235b60332938b30837fc9450b","tarball":"https://registry.npmjs.org/@dollardonationclub/impactapi-js/-/impactapi-js-0.2.0.tgz","fileCount":6,"integrity":"sha512-CruYYXb79ij76g/KmakR4KKUrjqK5RJ3LOxGcUARlZwLUmir34pwkUfLwEWMifgw1sPlhU/ZFyubjqvffejcnw==","signatures":[{"sig":"MEYCIQCSjojA6TeJZRCLwSq1ygC8PqZsJ1QLcYVBzaDfEPgWygIhAJYT2lhHygELLdRZOi2SJxe20Cn5Kp6wYXhgNe0NnS6Y","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79472},"main":"./dist/index.js","type":"module","_from":"file:dollardonationclub-impactapi-js-0.2.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","clean":"rm -rf dist","lint:fix":"eslint . --fix","type-check":"tsc --noEmit","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"},"_resolved":"/private/var/folders/ls/qh2twh6j5k15bnmsbvx4jn6c0000gn/T/0f0ea57af19cf15739e545f1a8302761/dollardonationclub-impactapi-js-0.2.0.tgz","_integrity":"sha512-CruYYXb79ij76g/KmakR4KKUrjqK5RJ3LOxGcUARlZwLUmir34pwkUfLwEWMifgw1sPlhU/ZFyubjqvffejcnw==","repository":{"url":"git+https://github.com/Dollar-Donation-Club/impactapi-sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"JavaScript SDK for integrating the DDC Impact Widget into any website","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.0","dotenv":"17.2.3","eslint":"9.36.0","globals":"16.4.0","prettier":"3.6.2","@eslint/js":"9.36.0","typescript":"^5.9.2","@ddc/shared":"0.0.0","@types/node":"^22.18.6","typescript-eslint":"8.44.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/impactapi-js_0.2.0_1761262837068_0.603403736812707","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@dollardonationclub/impactapi-js","version":"0.2.1","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"author":{"name":"Dollar Donation Club"},"license":"MIT","_id":"@dollardonationclub/impactapi-js@0.2.1","maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"homepage":"https://github.com/Dollar-Donation-Club/impactapi-sdk#readme","bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-sdk/issues"},"dist":{"shasum":"21a242f3547429c44e05fac79a9865aa0f295738","tarball":"https://registry.npmjs.org/@dollardonationclub/impactapi-js/-/impactapi-js-0.2.1.tgz","fileCount":6,"integrity":"sha512-kQxDU/dtdD1Fci5M6uIHYWtSt2kilQ+6KrKHPQqg7r6ezll9n6cTg0QE7C1r4rfmLc4JlMtxzFtsFLaJ36s0AQ==","signatures":[{"sig":"MEYCIQCQ47dQSFLmidXXpv8N+Shig9au6QZhNMHnTIQsCPaocQIhANecrbdIwUZprmsMVwKAOyLM2UWc4zwL572I4gMYq4W4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":83154},"main":"./dist/index.js","type":"module","_from":"file:dollardonationclub-impactapi-js-0.2.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","clean":"rm -rf dist","lint:fix":"eslint . --fix","type-check":"tsc --noEmit","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"},"_resolved":"/private/var/folders/ls/qh2twh6j5k15bnmsbvx4jn6c0000gn/T/788851886e9fab777ece349f3eea3598/dollardonationclub-impactapi-js-0.2.1.tgz","_integrity":"sha512-kQxDU/dtdD1Fci5M6uIHYWtSt2kilQ+6KrKHPQqg7r6ezll9n6cTg0QE7C1r4rfmLc4JlMtxzFtsFLaJ36s0AQ==","repository":{"url":"git+https://github.com/Dollar-Donation-Club/impactapi-sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"JavaScript SDK for integrating the DDC Impact Widget into any website","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.0","dotenv":"17.2.3","eslint":"9.36.0","globals":"16.4.0","prettier":"3.6.2","@eslint/js":"9.36.0","typescript":"^5.9.2","@ddc/shared":"0.0.0","@types/node":"^22.18.6","typescript-eslint":"8.44.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/impactapi-js_0.2.1_1761269582331_0.7045779006578992","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@dollardonationclub/impactapi-js","version":"0.3.0","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"author":{"name":"Dollar Donation Club"},"license":"MIT","_id":"@dollardonationclub/impactapi-js@0.3.0","maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"homepage":"https://github.com/Dollar-Donation-Club/impactapi-sdk#readme","bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-sdk/issues"},"dist":{"shasum":"8488268a056123cf483cbcb7e1d2a77014885b69","tarball":"https://registry.npmjs.org/@dollardonationclub/impactapi-js/-/impactapi-js-0.3.0.tgz","fileCount":6,"integrity":"sha512-yM3645jDCjizQy6D2+db1lz9uEsN8KdIQ3Y5Qi8oVDMrvcZenPKDpU4RH5XJgqMNwQ+rWDjHbluw3SB2z37jXA==","signatures":[{"sig":"MEUCIQCmsgUhMcD1JVzBUbdjkRI+axlY0wUEqxbbeGqo6Kag3QIgKtmLl+Jj2Kn6HLdYLRo0r0olztvyDKe/u0ooO56H9NA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86063},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"e199b04b08c78ae5329664ef461dd17406ca32cd","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","clean":"rm -rf dist","lint:fix":"eslint . --fix","type-check":"tsc --noEmit","prepublishOnly":"pnpm run build:production","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"},"repository":{"url":"git+https://github.com/Dollar-Donation-Club/impactapi-sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"JavaScript SDK for integrating the DDC Impact Widget into any website","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.0","dotenv":"17.2.3","eslint":"9.36.0","globals":"16.4.0","prettier":"3.6.2","@eslint/js":"9.36.0","typescript":"^5.9.2","@ddc/shared":"workspace:*","@types/node":"^22.18.6","typescript-eslint":"8.44.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/impactapi-js_0.3.0_1764035789303_0.7359157407649057","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@dollardonationclub/impactapi-js","version":"0.4.0","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"author":{"name":"Dollar Donation Club"},"license":"MIT","_id":"@dollardonationclub/impactapi-js@0.4.0","maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"homepage":"https://github.com/Dollar-Donation-Club/impactapi-sdk#readme","bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-sdk/issues"},"dist":{"shasum":"eaf075f2f54e2cc4dbc3b84dbce4365cbccba8ed","tarball":"https://registry.npmjs.org/@dollardonationclub/impactapi-js/-/impactapi-js-0.4.0.tgz","fileCount":6,"integrity":"sha512-CpfbfEgkJvVD2cVMVttrUTqPHCk2hRXdIFnkVTohVOPFWzTerNVT0P/PWLeVmQzh6aFmm1Rl0X/N2vpsivNRag==","signatures":[{"sig":"MEUCIEvPuLYPYNicz95oP79Y+9rfBorZy/xml280bER32XdaAiEAq0t/ZgKWVmiGUZXwFT3Q6wFpzhBp2Egv/ZOxDih0xAA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":132925},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3bb10722ccb3dfa9e3fd5ec459942a0e8643e567","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","clean":"rm -rf dist","lint:fix":"eslint . --fix","type-check":"tsc --noEmit","prepublishOnly":"pnpm run build:production","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"},"repository":{"url":"git+https://github.com/Dollar-Donation-Club/impactapi-sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"JavaScript SDK for integrating the DDC Impact Widget into any website","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.0","dotenv":"17.2.3","eslint":"9.36.0","globals":"16.4.0","prettier":"3.6.2","@eslint/js":"9.36.0","typescript":"^5.9.2","@ddc/shared":"workspace:*","@types/node":"^22.18.6","typescript-eslint":"8.44.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/impactapi-js_0.4.0_1768288495087_0.12910867339251908","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@dollardonationclub/impactapi-js","version":"0.5.0","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"author":{"name":"Dollar Donation Club"},"license":"MIT","_id":"@dollardonationclub/impactapi-js@0.5.0","maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"homepage":"https://github.com/Dollar-Donation-Club/impactapi-sdk#readme","bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-sdk/issues"},"dist":{"shasum":"a5cadf111927f08bf92663d0410184b703c1daca","tarball":"https://registry.npmjs.org/@dollardonationclub/impactapi-js/-/impactapi-js-0.5.0.tgz","fileCount":6,"integrity":"sha512-GJ0fhOECxFoyE7qw6ySC0E7VXUPnqdMMHfbyIDuevq08QybW1nKufRdOVNMi4iXOCbVkQ/124UNs7J2PTIPylg==","signatures":[{"sig":"MEQCICZ/wpUUSElOdBwOVuIMFO/BksOL/turHQctuGsKnEYBAiBQSx9LNUuLVw5/zDHZrC+VWBGlx6qIKwOH0QxnfWtuJw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":137367},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"fa180245610f47f54cb2c839adc385a888ce754d","scripts":{"dev":"tsup --watch","lint":"eslint .","build":"tsup","clean":"rm -rf dist","lint:fix":"eslint . --fix","type-check":"tsc --noEmit","prepublishOnly":"pnpm run build:production","build:production":"NODE_ENV=production tsup"},"_npmUser":{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"},"repository":{"url":"git+https://github.com/Dollar-Donation-Club/impactapi-sdk.git","type":"git"},"_npmVersion":"11.6.2","description":"JavaScript SDK for integrating the DDC Impact Widget into any website","directories":{},"_nodeVersion":"22.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"8.5.0","dotenv":"17.2.3","eslint":"9.36.0","globals":"16.4.0","prettier":"3.6.2","@eslint/js":"9.36.0","typescript":"^5.9.2","@ddc/shared":"workspace:*","@types/node":"^22.18.6","typescript-eslint":"8.44.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/impactapi-js_0.5.0_1770261440666_0.6296782679762523","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@dollardonationclub/impactapi-js","version":"0.5.1","description":"JavaScript SDK for integrating the DDC Impact Widget into any website","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"license":"MIT","author":{"name":"Dollar Donation Club"},"publishConfig":{"access":"public","provenance":true},"repository":{"type":"git","url":"git+https://github.com/Dollar-Donation-Club/impactapi-js.git"},"homepage":"https://github.com/Dollar-Donation-Club/impactapi-js#readme","bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-js/issues"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"96fae8eb997b9ba76c77cabaaac3d2e32b32b2d5","_id":"@dollardonationclub/impactapi-js@0.5.1","_nodeVersion":"24.18.0","_npmVersion":"12.0.1","dist":{"integrity":"sha512-TxkDJoE7GZ0iq/6Dq9nB01K7X4sBM1nA3XdHMoO3pbvjDSadbfI8ATSxOKnmVpOwHft7GD+K8yNXaSkOq69+Ew==","shasum":"97fe7ae824b5bb7465b9f5813d08cc76fc621332","tarball":"https://registry.npmjs.org/@dollardonationclub/impactapi-js/-/impactapi-js-0.5.1.tgz","fileCount":6,"unpackedSize":136861,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dollardonationclub%2fimpactapi-js@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD5xo/QIziCpoU2wDs3bSKeXRP8Qf2EAkFE7rbseHAeGQIgMyDyyByHPVMDALnKYWn/+gN/joR4MGw8BXs95rqxQz4="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:05e7b507-78d6-4a59-b2cb-be26733e8182"}},"directories":{},"maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/impactapi-js_0.5.1_1784301758186_0.27185116710494883"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-14T15:49:28.031Z","modified":"2026-07-17T15:22:38.713Z","0.1.0":"2025-10-14T15:49:28.414Z","0.1.1":"2025-10-16T19:14:57.769Z","0.2.0":"2025-10-23T23:40:37.298Z","0.2.1":"2025-10-24T01:33:02.524Z","0.3.0":"2025-11-25T01:56:29.496Z","0.4.0":"2026-01-13T07:14:55.241Z","0.5.0":"2026-02-05T03:17:20.862Z","0.5.1":"2026-07-17T15:22:38.364Z"},"bugs":{"url":"https://github.com/Dollar-Donation-Club/impactapi-js/issues"},"author":{"name":"Dollar Donation Club"},"license":"MIT","homepage":"https://github.com/Dollar-Donation-Club/impactapi-js#readme","keywords":["widget","sdk","impact","donation","dollardonationclub","impactapi","ddc","iframe","embed"],"repository":{"type":"git","url":"git+https://github.com/Dollar-Donation-Club/impactapi-js.git"},"description":"JavaScript SDK for integrating the DDC Impact Widget into any website","maintainers":[{"name":"guilherme.ddc","email":"guilherme@dollardonationclub.com"}],"readme":"# @dollardonationclub/impactapi-js\n\nJavaScript SDK for integrating the DDC Impact Widget into any website. This SDK provides a simple interface for embedding and interacting with the DDC Impact Widget through a secure iframe-based communication layer.\n\n## Installation\n\n```bash\nnpm install @dollardonationclub/impactapi-js\n# or\nyarn add @dollardonationclub/impactapi-js\n# or\npnpm add @dollardonationclub/impactapi-js\n```\n\n## Quick Start\n\n### Production Widget (with API session)\n\n```javascript\nimport { createWidget } from '@dollardonationclub/impactapi-js'\n\n// Create and mount the widget\nconst widget = createWidget({\n  sessionId: 'your-session-id',\n  secret: 'your-secret-key',\n})\n\n// Mount to a container\nawait widget.mount('#widget-container')\n\n// Listen for events\nwidget.on('ready', (data) => {\n  console.log('Widget ready:', data)\n})\n\nwidget.on('allocations-updated', (data) => {\n  console.log('Allocations:', data.allocations)\n  console.log('Total amount:', data.totalAmount)\n})\n```\n\n### Preview Widget (client-side demo)\n\n```javascript\nimport { createPreviewWidget } from '@dollardonationclub/impactapi-js'\n\n// Create a preview widget for demos/testing - no API calls\nconst previewWidget = createPreviewWidget({\n  type: 'add_on',\n  amount: 500, // $5.00 in cents\n  available_campaigns: ['yellow-rooms', 'trees-for-the-future'],\n  styleMode: 'light'\n})\n\nawait previewWidget.mount('#preview-container')\n```\n\n### Metrics Widget (impact history display)\n\n```javascript\nimport { createMetricsWidget } from '@dollardonationclub/impactapi-js'\n\n// Create a metrics widget to display donation impact history\nconst metricsWidget = createMetricsWidget({\n  sessionId: 'your-session-id',\n  secret: 'your-secret-key',\n})\n\nawait metricsWidget.mount('#metrics-container')\n\n// Listen for metrics data\nmetricsWidget.on('metrics-loaded', (data) => {\n  console.log('Total donations:', data.summary.totalDonations)\n  console.log('History:', data.history)\n})\n```\n\n## Configuration\n\n### WidgetConfig (Production)\n\n```typescript\ninterface WidgetConfig {\n  sessionId: string         // Session ID from your backend\n  secret: string            // Secret key for authentication\n  styleMode?: WidgetStyleMode // Widget appearance (optional)\n}\n\ntype WidgetStyleMode = 'gradient' | 'solid' | 'light' | 'dark'\n```\n\n**Notes:**\n- The widget URL is configured at build time and points to the DDC Impact Widget iframe\n- Debug logging is automatically enabled in development (`NODE_ENV !== 'production'`)\n- The SDK handles all iframe configuration and postMessage security automatically\n\n### PreviewWidgetConfig (Demo/Testing)\n\nPreview widgets allow you to demo the widget functionality without making API calls. Perfect for testing, documentation, or showcasing the widget before integration.\n\n```typescript\ntype PreviewWidgetConfig =\n  | PreviewWidgetConfigAddOn\n  | PreviewWidgetConfigPortionOfSalesChoice\n  | PreviewWidgetConfigPortionOfSales\n\n// Customer-paid donation: customer pays and chooses\ninterface PreviewWidgetConfigAddOn {\n  type: 'add_on'\n  amount: number                    // Amount in cents\n  available_campaigns: string[]     // Campaign slugs to show\n  styleMode?: WidgetStyleMode       // Widget appearance\n}\n\n// Vendor-paid with choice: vendor pays, customer chooses\ninterface PreviewWidgetConfigPortionOfSalesChoice {\n  type: 'portion_of_sales_choice'\n  amount: number                    // Amount in cents\n  available_campaigns: string[]     // Campaign slugs to show\n  styleMode?: WidgetStyleMode\n}\n\n// Vendor-paid, pre-allocated: displays fixed allocations\ninterface PreviewWidgetConfigPortionOfSales {\n  type: 'portion_of_sales'\n  allocations: Array<{\n    campaign_identifier: string     // Campaign slug\n    amount: number                  // Amount in cents\n  }>\n  styleMode?: WidgetStyleMode\n}\n```\n\n**Notes:**\n- Preview widgets operate entirely client-side - no API calls are made\n- Changes are not persisted to any backend\n- The widget fetches campaign data from the production API to display real campaign information\n- Ideal for demos, testing, and documentation\n\n### MetricsWidgetConfig\n\nThe metrics widget displays donation impact history and summary data.\n\n```typescript\ninterface MetricsWidgetConfig {\n  sessionId: string                    // Session ID from your backend\n  secret: string                       // Secret key for authentication\n  styleMode?: MetricsWidgetStyleMode   // Widget appearance (optional)\n  size?: MetricsWidgetSize             // Widget size (optional)\n}\n\ntype MetricsWidgetStyleMode = 'light' | 'dark' | 'white'\ntype MetricsWidgetSize = 'default' | 'compact'\n```\n\n## API Reference\n\n### `createWidget(config: WidgetConfig): Widget`\n\nCreates a new production widget instance that connects to your backend session.\n\n### `createPreviewWidget(config: PreviewWidgetConfig): Widget`\n\nCreates a preview widget instance for demos and testing. Returns the same `Widget` interface as `createWidget`, but operates entirely client-side without persisting changes to the API.\n\n### `createMetricsWidget(config: MetricsWidgetConfig): MetricsWidget`\n\nCreates a metrics widget instance that displays donation impact history and summary data. Unlike the other widgets which handle donation allocation, this widget is read-only and shows historical impact metrics.\n\n### Widget Methods\n\n#### `mount(container: HTMLElement | string): Promise<void>`\n\nMounts the widget iframe into the specified container. Accepts either a DOM element or a CSS selector string.\n\n```javascript\n// Using a selector\nawait widget.mount('#my-container')\n\n// Using an element\nconst container = document.getElementById('my-container')\nawait widget.mount(container)\n```\n\n#### `destroy(): void`\n\nDestroys the widget and cleans up all resources including event listeners and the iframe.\n\n#### `isReady(): boolean`\n\nReturns whether the widget has finished loading and is ready to use.\n\n#### `getSessionId(): string`\n\nGets the unique session ID for this widget instance.\n\n#### `getSessionData(): SessionData | null`\n\nGets the current session data including campaigns, allocations, and configuration.\n\n#### `getAllocations(): Allocation[]`\n\nGets the current allocations for this session.\n\n#### `getType(): SessionType | null`\n\nGets the session type. Returns one of:\n- `\"portion_of_sales\"` - Non-interactive: displays allocations from the API (set on backend)\n- `\"portion_of_sales_choice\"` - Interactive: vendor pays, customer chooses allocations\n- `\"add_on\"` - Interactive: customer pays and chooses allocations\n\n#### `refresh(): Promise<void>`\n\nRefetches session data from the API. Useful for getting updated allocations or campaign data.\n\n### Event Handling\n\n#### `on<K>(event: K, handler: (data) => void): this`\n\nRegisters an event listener. Returns the widget instance for chaining.\n\n```javascript\nwidget\n  .on('ready', (data) => console.log('Ready:', data))\n  .on('error', (error) => console.error('Error:', error))\n```\n\n#### `off<K>(event: K, handler?: (data) => void): this`\n\nRemoves an event listener. If no handler is provided, removes all listeners for that event.\n\n#### `waitFor<K>(event: K, options?: { timeout?: number }): Promise<EventData>`\n\nWaits for a specific event to fire. Returns a promise that resolves with the event data.\n\n```javascript\ntry {\n  const readyData = await widget.waitFor('ready', { timeout: 5000 })\n  console.log('Widget ready:', readyData)\n} catch (error) {\n  console.error('Timeout waiting for ready event')\n}\n```\n\n### Events\n\nThe widget emits the following events:\n\n#### `ready`\nFired when the widget has finished initializing.\n\n```typescript\ninterface ReadyEventData {\n  sessionId: string\n  version: string\n  type: SessionType\n}\n```\n\n#### `allocations-updated`\nFired when allocations are updated (interactive mode only).\n\n```typescript\ninterface AllocationsUpdatedEventData {\n  allocations: Allocation[]\n  totalAmount: number\n}\n```\n\n#### `session-updated`\nFired when session data changes.\n\n```typescript\ntype SessionData = SessionDataAddOn | SessionDataPortionOfSalesChoice | SessionDataPortionOfSales\n```\n\n#### `error`\nFired when an error occurs.\n\n```typescript\ninterface ErrorEventData {\n  message: string\n  stack?: string\n}\n```\n\n#### `resize`\nFired when the widget requests a size change.\n\n```typescript\ninterface ResizeEventData {\n  width?: number\n  height?: number\n}\n```\n\n#### `destroyed`\nFired when the widget is destroyed.\n\n```typescript\ninterface DestroyedEventData {\n  sessionId: string\n}\n```\n\n### MetricsWidget Methods\n\nThe `MetricsWidget` interface is similar to `Widget` but tailored for displaying impact metrics.\n\n#### `mount(container: HTMLElement | string): Promise<void>`\n\nMounts the metrics widget iframe into the specified container.\n\n#### `destroy(): void`\n\nDestroys the widget and cleans up all resources.\n\n#### `isReady(): boolean`\n\nReturns whether the widget has finished loading.\n\n#### `getSessionId(): string`\n\nGets the unique session ID for this widget instance.\n\n#### `getMetrics(): MetricsData | null`\n\nGets the current metrics data including summary and history.\n\n```typescript\ninterface MetricsData {\n  summary: MetricsSummary\n  history: MetricsHistoryItem[]\n  pagination: MetricsPagination\n}\n```\n\n#### `refresh(): Promise<void>`\n\nRefetches metrics data from the API.\n\n#### Event Methods\n\nThe metrics widget supports the same event handling methods as the regular widget: `on()`, `off()`, and `waitFor()`.\n\n### Metrics Widget Events\n\nThe metrics widget emits the following events:\n\n#### `ready`\nFired when the widget has finished initializing.\n\n```typescript\ninterface MetricsReadyEventData {\n  sessionId: string\n  version: string\n}\n```\n\n#### `metrics-loaded`\nFired when metrics data is fetched from the API.\n\n```typescript\ninterface MetricsData {\n  summary: MetricsSummary\n  history: MetricsHistoryItem[]\n  pagination: MetricsPagination\n}\n```\n\n#### `filter-changed`\nFired when the user changes the metric filter.\n\n```typescript\ninterface MetricsFilterChangedEventData {\n  selectedMetricIdentifier: string | null\n}\n```\n\n#### `error`\nFired when an error occurs.\n\n#### `resize`\nFired when the widget requests a size change.\n\n#### `destroyed`\nFired when the widget is destroyed.\n\n## Preview Widget Examples\n\nPreview widgets are perfect for demos, testing, and showcasing the widget before full integration.\n\n### Add-On Widget (Customer Pays)\n\n```javascript\nimport { createPreviewWidget } from '@dollardonationclub/impactapi-js'\n\nconst widget = createPreviewWidget({\n  type: 'add_on',\n  amount: 500, // $5.00 in cents\n  available_campaigns: ['yellow-rooms', 'trees-for-the-future'],\n  styleMode: 'gradient'\n})\n\nawait widget.mount('#container')\n```\n\n### Portion of Sales Choice (Vendor Pays, Customer Chooses)\n\n```javascript\nconst widget = createPreviewWidget({\n  type: 'portion_of_sales_choice',\n  amount: 1000, // $10.00 in cents\n  available_campaigns: ['yellow-rooms', 'trees-for-the-future', 'plastic-fischer'],\n  styleMode: 'light'\n})\n\nawait widget.mount('#container')\n```\n\n### Portion of Sales (Vendor Pays, Pre-Allocated)\n\n```javascript\nconst widget = createPreviewWidget({\n  type: 'portion_of_sales',\n  allocations: [\n    { campaign_identifier: 'yellow-rooms', amount: 300 },\n    { campaign_identifier: 'trees-for-the-future', amount: 200 }\n  ],\n  styleMode: 'dark'\n})\n\nawait widget.mount('#container')\n```\n\n## Metrics Widget Example\n\n```javascript\nimport { createMetricsWidget } from '@dollardonationclub/impactapi-js'\n\n// Create metrics widget\nconst metricsWidget = createMetricsWidget({\n  sessionId: 'your-session-id',\n  secret: 'your-secret-key',\n  styleMode: 'light',\n  size: 'default'\n})\n\n// Mount and handle lifecycle\nasync function initMetricsWidget() {\n  try {\n    await metricsWidget.mount('#metrics-container')\n    console.log('Metrics widget mounted successfully')\n  } catch (error) {\n    console.error('Failed to mount metrics widget:', error)\n  }\n}\n\n// Event handlers\nmetricsWidget\n  .on('ready', (data) => {\n    console.log('Metrics widget ready:', data.sessionId)\n  })\n  .on('metrics-loaded', (data) => {\n    console.log('Total donations:', data.summary.totalDonations)\n    console.log('Total amount:', data.summary.totalAmountCents)\n    console.log('Donation history:', data.history)\n  })\n  .on('filter-changed', (data) => {\n    console.log('Filter changed to:', data.selectedMetricIdentifier)\n  })\n  .on('error', (error) => {\n    console.error('Metrics widget error:', error)\n  })\n\n// Initialize\ninitMetricsWidget()\n\n// Cleanup when done\nwindow.addEventListener('beforeunload', () => {\n  metricsWidget.destroy()\n})\n```\n\n## TypeScript Support\n\nThis package includes full TypeScript definitions. All types are exported for your convenience:\n\n```typescript\nimport {\n  createWidget,\n  createPreviewWidget,\n  createMetricsWidget,\n  type Widget,\n  type WidgetConfig,\n  type PreviewWidgetConfig,\n  type MetricsWidget,\n  type MetricsWidgetConfig,\n  type MetricsData,\n  type Allocation,\n  type Campaign,\n  type SessionData,\n  WidgetError,\n  WidgetErrorCode\n} from '@dollardonationclub/impactapi-js'\n\n// Production widget\nconst config: WidgetConfig = {\n  sessionId: 'session-123',\n  secret: 'secret-key',\n  styleMode: 'gradient'\n}\nconst widget: Widget = createWidget(config)\n\n// Preview widget\nconst previewConfig: PreviewWidgetConfig = {\n  type: 'add_on',\n  amount: 500,\n  available_campaigns: ['yellow-rooms'],\n  styleMode: 'light'\n}\nconst previewWidget: Widget = createPreviewWidget(previewConfig)\n\n// Metrics widget\nconst metricsConfig: MetricsWidgetConfig = {\n  sessionId: 'session-123',\n  secret: 'secret-key',\n  styleMode: 'light',\n  size: 'default'\n}\nconst metricsWidget: MetricsWidget = createMetricsWidget(metricsConfig)\n```\n\n## Error Handling\n\nThe SDK exports error types for structured error handling:\n\n```javascript\nimport { WidgetError, WidgetErrorCode, WidgetErrors } from '@dollardonationclub/impactapi-js'\n\nwidget.on('error', (error) => {\n  if (error instanceof WidgetError) {\n    switch (error.code) {\n      case WidgetErrorCode.CONTAINER_NOT_FOUND:\n        console.error('Container element not found')\n        break\n      case WidgetErrorCode.SESSION_EXPIRED:\n        console.error('Session has expired')\n        break\n      // ... handle other error codes\n    }\n  }\n})\n```\n\n## Complete Example\n\n```javascript\nimport { createWidget } from '@dollardonationclub/impactapi-js'\n\n// Create widget with custom configuration\nconst widget = createWidget({\n  sessionId: 'your-session-id',\n  secret: 'your-secret-key',\n  styleMode: 'gradient'\n})\n\n// Mount and handle lifecycle\nasync function initWidget() {\n  try {\n    await widget.mount('#widget-container')\n    console.log('Widget mounted successfully')\n  } catch (error) {\n    console.error('Failed to mount widget:', error)\n  }\n}\n\n// Event handlers\nwidget\n  .on('ready', (data) => {\n    console.log('Widget ready:', data.sessionId)\n    console.log('Session type:', data.type)\n  })\n  .on('allocations-updated', (data) => {\n    console.log('New allocations:', data.allocations)\n    console.log('Total amount:', data.totalAmount)\n  })\n  .on('error', (error) => {\n    console.error('Widget error:', error)\n  })\n\n// Initialize\ninitWidget()\n\n// Cleanup when done\nwindow.addEventListener('beforeunload', () => {\n  widget.destroy()\n})\n```\n\n## Security\n\n- All communication between the parent page and widget iframe uses secure postMessage\n- Origin validation is performed on all messages\n- Session secrets should be kept confidential and never exposed in client-side code\n- HTTPS is required for production environments\n\n## Browser Support\n\n- Modern browsers (Chrome, Firefox, Safari, Edge)\n- ES2020+ JavaScript features\n- Requires support for ES modules\n\n## License\n\nMIT\n","readmeFilename":"README.md"}