klaviyo-subscribe
Advanced tools
Comparing version 0.0.3 to 1.0.0
@@ -1,2 +0,2 @@ | ||
export default function(e,t,n){void 0===n&&(n={});var r=Object.assign({},n,{g:e,email:t}),o=Object.keys(r).reduce(function(e,t){return e.append(t,r[t]),e},new URLSearchParams);return fetch("https://a.klaviyo.com/ajax/subscriptions/subscribe",{method:"POST",headers:{"Access-Control-Allow-Headers":"*","Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:o}).then(function(e){return e.json()})}; | ||
function e(e,t,n){void 0===n&&(n={});var r=Object.assign({},n,{g:e,email:t}),s=Object.keys(r).reduce(function(e,t){return e.append(t,r[t]),e},new URLSearchParams);return fetch("https://manage.kmail-lists.com/ajax/subscriptions/subscribe",{method:"POST",headers:{"Access-Control-Allow-Headers":"*","Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:s}).then(function(e){return e.json()})}export{e as subscribe}; | ||
//# sourceMappingURL=klaviyo-subscribe.es.js.map |
@@ -1,2 +0,2 @@ | ||
module.exports=function(e,t,n){void 0===n&&(n={});var o=Object.assign({},n,{g:e,email:t}),r=Object.keys(o).reduce(function(e,t){return e.append(t,o[t]),e},new URLSearchParams);return fetch("https://a.klaviyo.com/ajax/subscriptions/subscribe",{method:"POST",headers:{"Access-Control-Allow-Headers":"*","Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:r}).then(function(e){return e.json()})}; | ||
exports.subscribe=function(e,t,n){void 0===n&&(n={});var s=Object.assign({},n,{g:e,email:t}),r=Object.keys(s).reduce(function(e,t){return e.append(t,s[t]),e},new URLSearchParams);return fetch("https://manage.kmail-lists.com/ajax/subscriptions/subscribe",{method:"POST",headers:{"Access-Control-Allow-Headers":"*","Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:r}).then(function(e){return e.json()})}; | ||
//# sourceMappingURL=klaviyo-subscribe.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.klaviyoSubscribe=n()}(this,function(){return function(e,n,t){void 0===t&&(t={});var o=Object.assign({},t,{g:e,email:n}),r=Object.keys(o).reduce(function(e,n){return e.append(n,o[n]),e},new URLSearchParams);return fetch("https://a.klaviyo.com/ajax/subscriptions/subscribe",{method:"POST",headers:{"Access-Control-Allow-Headers":"*","Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:r}).then(function(e){return e.json()})}}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.klaviyoSubscribe={})}(this,function(e){e.subscribe=function(e,n,t){void 0===t&&(t={});var o=Object.assign({},t,{g:e,email:n}),s=Object.keys(o).reduce(function(e,n){return e.append(n,o[n]),e},new URLSearchParams);return fetch("https://manage.kmail-lists.com/ajax/subscriptions/subscribe",{method:"POST",headers:{"Access-Control-Allow-Headers":"*","Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:s}).then(function(e){return e.json()})}}); | ||
//# sourceMappingURL=klaviyo-subscribe.umd.js.map |
{ | ||
"name": "klaviyo-subscribe", | ||
"version": "0.0.3", | ||
"version": "1.0.0", | ||
"description": "Tiny Klaviyo list subscribe utility.", | ||
@@ -5,0 +5,0 @@ "source": "index.js", |
@@ -1,5 +0,7 @@ | ||
# klaviyo-subscribe | ||
Tiny Klaviyo list subscribe utility. **320 bytes gzipped.** | ||
# klaviyo-subscribe  [](https://bundlephobia.com/result?p=klaviyo-subscribe) | ||
Tiny Klaviyo list subscribe utility. | ||
## Install | ||
``` | ||
@@ -10,15 +12,32 @@ npm i klaviyo-subscribe --save | ||
# Usage | ||
```javascript | ||
import subscribe from 'klaviyo-subscribe' | ||
import subscribe from "klaviyo-subscribe"; | ||
const listId = 'JFDd6y' | ||
const email = 'email@email.com' | ||
const listId = "JFDd6y"; | ||
const email = "email@email.com"; | ||
subscribe(listId, email, { | ||
$first_name: 'Eric', | ||
$first_name: "Eric" | ||
// any optional traits | ||
}).then(response => {}) | ||
}).then(response => {}); | ||
``` | ||
Sending Custom field data into a list: | ||
```javascript | ||
import subscribe from "klaviyo-subscribe"; | ||
const listId = "JFDd6y"; | ||
const email = "email@email.com"; | ||
subscribe(listId, email, { | ||
$fields: ["Size", "Type"], | ||
Size: 10, | ||
Type: "US Mens" | ||
}).then(response => {}); | ||
``` | ||
## License | ||
MIT License © [Eric Bailey](https://estrattonbailey.com) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
43
6944
8
10
4