# mailchimp-subscription-middleware

> Middleware to enable server-side mailchimp subscription requests

Latest version **0.0.3** (published 2016-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install mailchimp-subscription-middleware
pnpm add mailchimp-subscription-middleware
yarn add mailchimp-subscription-middleware
bun add mailchimp-subscription-middleware
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2016-09-22 |
| First published | 2016-09-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin Altman |
| Maintainers | itg |
| Keywords | mailchimp, middleware, subscribe, subscription |

## Links

- npm: https://www.npmjs.com/package/mailchimp-subscription-middleware
- Repository: https://github.com/itsthatguy/mailchimp-subscription-middleware
- Homepage: https://github.com/itsthatguy/mailchimp-subscription-middleware#readme
- Issues: https://github.com/itsthatguy/mailchimp-subscription-middleware/issues
- npm.io page: https://npm.io/package/mailchimp-subscription-middleware

## Recent versions

- 0.0.3 (latest) — 2016-09-22
- 0.0.2 — 2016-09-22
- 0.0.1 — 2016-09-22

## README

# MailChimp Subscription Middleware

## Assumptions
* You have a mailchimp account
* You've created a list
* You have an API Key
* You know what a computer is

## Use it
* API key
http://kb.mailchimp.com/integrations/api-integrations/about-api-keys
* List ID http://kb.mailchimp.com/lists/managing-subscribers/find-your-list-id
**Do not** remove the `-<datacenter>` at the end of your API token

```javascript
// express.js example
var mcSubscriber = require('mailchimp-subscription-middleware');

var options = {
  apiKey: 'abcdefghijklmnopqrstuvwxyz123456-us12',
  listId: '9e67587f52'
};

app.use('/subscribe', mcSubscriber(options));
```

```javascript
// browsersync example
// assumes that you have browsersync setup. This only shows how to use the
// middleware in your existing setup
// https://www.browsersync.io/docs/options/
var mcSubscriber = require('mailchimp-subscription-middleware');

var options = {
  apiKey: 'abcdefghijklmnopqrstuvwxyz123456-us12',
  listId: '9e67587f52'
};
var browserSyncOptions = {
  ...
  middleware: [{
    route: '/subscribe',
    handle: mcSubscriber(options)
  }]
  ...
};
```

## Response

```javascript
{
  "data": <Mailchimp Server Response>
}
```

---
_Source: https://npm.io/package/mailchimp-subscription-middleware · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
