New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sendgrid-contacts-export

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sendgrid-contacts-export

The simplest way to get all your SendGrid contacts as JSON.

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

SendGrid Contacts Export for Node.js

Main repo: https://github.com/huned/nodejs-sendgrid-contacts-export

The simplest way to get all your SendGrid contacts as JSON.

Installation

npm install sendgrid-contacts-export

Usage

Use it like this:

const SendGrid = require(./lib/sendgrid)
const sg = new SendGrid('MY API KEY')
const contacts = await sg.getContacts()
console.log(contacts)

Optionally, specify options using SendGrid's Contacts Export API options. E.g.,

// See SendGrid's Marketing > Contacts > Exports API doc for details.
// https://sendgrid.com/docs/API_Reference/api_v3.html
const opts = {
  "list_ids": [ "string" ],
  "segment_ids": [ "string" ],
  "notifications": {
    "email": "boolean (optional)"
  },
  "file_type": "csv",
  "max_file_size": 5000
}
await sg.getContacts(opts)

Command Line Usage

Clone this repo, then:

SENDGRID_API_KEY=<your api key> npm start

And it will print all your contacts as JSON to stdout.

You can also set SENDGRID_LIST_IDS and SENDGRID_SEGMENT_IDS to comma separated list/segment ids. E.g.,

SENDGRID_API_KEY=<your api key> SENDGRID_LIST_IDS=<list1 id>,<list2 id> npm start

You can also define each of these environment in a ./.env file instead of at the command line, if you wish.

Known Issues

  • No tests yet (maybe you can submit a PR?!)

Author

Huned Botee

License

MIT

Keywords

sendgrid

FAQs

Package last updated on 12 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts