Socket
Socket
Sign inDemoInstall

unisender-node

Package Overview
Dependencies
23
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    unisender-node

Unisender SDK (TypeScript)


Version published
Maintainers
1
Install size
1.42 MB
Created

Changelog

Source

0.0.7

Patch Changes

  • Moving Unisender to types

Readme

Source

Unisender SDK

💥 Work in progress!

API documentation

  • Документация API на русском

  • English API docs

Usage example

Installation

yarn add unisender-node

or

npm i unisender-node

Basic usage

import Unisender from 'unisender-node'


const sdk = new Unisender({ apiKey: 'my-secret-key', lang: 'en' })

// Getting lists
const lists = sdk.getLists()

All responses are typed and mirroring Unisender API responses

Using environment variables

SDK will check for these ENV variables:

  • UNISENDER_API_KEY
  • UNISENDER_LANG

If you provide these variables, you don't need to provide in constructor.

import Unisender from 'unisender-node'

const sdk = new Unisender()

Examples

Import contacts


// Two ways to pass data
// 1. Unisender way - CSV-style array of arrays with field_names
const result = await sdk.importContacts({
    field_names: ['email', 'Name'],
    data: [
      ['test1@example.com', 'Test name'],
      ['test2@example.com', 'Test name2']
    ]
  })
// 2. Simple object
const result = await sdk.importContacts({
  data: [
    { email: 'test1@example.com', Name: 'Test name' },
    { email: 'test2@example.com', Name: 'Test2 name' },
  ]
})

Implementation progress

Contacts

MethodStatus
getLists
createList
updateList
deleteList
subscribe
unsubscribe
exclude
importContacts
importContactsBatch *
exportContacts
getTaskResult
getContact
getContactCount
getTotalContactsCount
isContactInLists
  • importContactsBatch - simple helper will divide importContacts in chunks with 500 items. Will return array of results of importContacts

Messaging

MethodStatus
createEmailMessage
updateEmailMessage
deleteMessage
getActualMessageVersion
sendTestEmail
sendEmail
checkEmail
createSmsMessage
sendSms
checkSms
createCampaign
cancelCampaign
getWebVersion
updateOptInEmail
getSenderDomainList

Statistics

MethodStatus
getCampaignCommonStats
getCampaignDeliveryStats
getCampaignStatus
getMessages
getVisitedLinks
listMessages🚧
getCampaigns🚧
getMessage🚧

Templates

MethodStatus
createEmailTemplate🚧
deleteTemplate🚧
getTemplate🚧
getTemplates🚧
listTemplates🚧
updateEmailTemplate🚧

Fields

MethodStatus
createField
deleteField
deleteTag
getFields
getTags
updateField
getContactFieldValues

FAQs

Last updated on 21 Jan 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc