Socket
Socket
Sign inDemoInstall

@plunk/node

Package Overview
Dependencies
4
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @plunk/node

Official Node.js library for useplunk.com


Version published
Weekly downloads
862
decreased by-13.37%
Maintainers
1
Install size
1.29 MB
Created
Weekly downloads
 

Readme

Source

Plunk Node.js

This project contains the helper library for interacting with the Plunk API using Node.js.

Table of contents

  • Installation
  • Getting started
  • API

Card

Installation

Installing the latest version can be done through your package manager.

npm i @plunk/node

yarn add @plunk/node

Getting started

Any interaction you want to make with the Plunk API needs to be done through the Plunk client. You can use a default import to get started.

import Plunk from '@plunk/node';

const plunk = new Plunk("Your secret key");

API

Events

track()

Used to publish an event

Parameters
  • event: The name of the event to publish
  • email: The email address of the user to publish the event to
  • subscribed [Optional]: Whether to the contact is subscribed to marketing emails, defaults to true
  • data [Optional]: An object containing the data to attach to the user
const success = await plunk.events.track({
  event: "new-project",
  email: "hello@useplunk.com",
  data: {
    company: "Plunk"
  }
});

Emails

send()

Used to send a transactional email

Parameters
  • to: The email address of the recipient
  • subject: The subject of the email
  • body: The body of the email
  • type [Optional]: The type of email to send (html or markdown)
  • from [Optional]: The email address of the sender
  • name [Optional]: The name of the sender
  • subscribed [Optional]: Whether to the contact is subscribed to marketing emails, defaults to false
const success = await plunk.emails.send({
  to: "hello@useplunk.com",
  subject: "Welcome to Plunk",
  body: "Hello world!",
});

Keywords

FAQs

Last updated on 31 Aug 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