3.0.0 • Published 8 months ago

@plunk/node v3.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Plunk Node.js

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

Table of contents

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!",
});
3.0.0

8 months ago

2.1.0

8 months ago

1.1.4

11 months ago

1.1.3

11 months ago

2.0.0

11 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago