Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

klaviyo-subscribe

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

klaviyo-subscribe - npm Package Compare versions

Comparing version 0.0.3 to 1.0.0

2

dist/klaviyo-subscribe.es.js

@@ -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 ![npm](https://img.shields.io/npm/v/klaviyo-subscribe) [![](https://badgen.net/bundlephobia/minzip/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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc