npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mysendingbox-node-pre-publish-test

v0.1.0

Published

Mysendingbox API wrapper

Readme

mysendingbox-node

Description

MySendingBox API wrapper. It allows you to send postcards, letters, campaigns and more from your application.

It's the rebranded and refactored version of the Seeuletter API wrapper. If you manage to migrate from Seeuletter to MySendingBox, please read the breaking changes.

Prerequisites

This package is written in TypeScript and requires Node.js v14.21.3 or higher and ESM support.

Documentation

You can find the documentation of the API here : https://docs.mysendingbox.fr

Installation

BEFORE YOU INSTALL : please read the prerequisites

npm install mysendingbox

Usage

import { MySendingBox } from 'mysendingbox';

const config = {
  apiKey: "YOUR_API_KEY",
  host: "MSB_HOST",
}

const msb = new MySendingBox(config);

/** Create a letter */
msb.letter.create({
  description: "My first test letter",
  to: {
    name: "John Doe",
    company: "My Company",
    address_line1: "1 rue du Louvre",
    address_city: "Paris",
    address_postalcode: "75000",
    address_country: "France",
  },
  from: {
    name: "John Doe",
    company: "My Company",
    address_line1: "1 rue du Louvre",
    address_city: "Paris",
    address_postalcode: "75000",
    address_country: "France",
  },
  color: "bw",
  postage_type: "prioritaire",
  source_file: createReadStream('test.html'),
  source_file_type: "html",
  content: "My letter content",
  content_type: "text",
  variables: {
    nom: "wrapper variable test"
  }
}).then((letter) => {
  console.log(letter);
}).catch((err) => {
  console.log(err);
});

/** Retrieve a specific Letter */
msb.letter.findById("LETTER_ID").then((letter) => {
  console.log(letter);
}).catch((err) => {
  console.log(err);
});

/** Retrieve all letters */
msb.letter.find().then((letter) => {
  console.log(letter);
}).catch((err) => {
  console.log(err);
});

BreakingChanges

Seeuletter to MySendingBox instance

The Seeuletter instance has been renamed to MySendingBox. You have now to instanciate the class by yourself. The constructor has been updated to accept a config object instead of a string. The config object has three properties: apiKey, host and timeout. The host property is optional and defaults to https://api.mysendingbox.com.

// Before
var Seeuletter = require('seeuletter')('YOUR_API_KEY');
// After
import MySendingBox from 'mysendingbox';

const config = {
  apiKey: "YOUR_API_KEY", // required could be found in your MySendingBox dashboard
  host: "MSB_HOST", // optional, defaults to https://api.mysendingbox.com
  timeout: 3000, // optional, defaults to 5000
}

const msb = new MySendingBox(config);

Seeuletter to MySendingBox Letters

The createElectronic method has been merged into a single method create. This method is now deprecated and you have to specify the channel of your choice paper or electronic as the create method first param.

// Before
Seeuletter.letters.createElectronic({
  description: 'Test electronic letter from the Node.js Wrapper',
  to: {
    email: '[email protected]',
    first_name: 'Erlich',
    last_name: 'Dumas',
    status: 'individual'
  },
  postage_type: 'lre',
  content: 'Please review the attached documents:',
  source_file: '<html>Hello, {{nom}}</html>',
  source_file_type: 'html',
  variables: {
    nom : 'Seeuletter'
  }
})
.then(function (response) {
  console.log('response : ', response);
})
.catch(function (err) {
  console.log('err : ', err);
});
// After
mysendingbox.letter.create('paper', {
  description: "My first test letter",
  to: {
    name: "John Doe",
    company: "My Company",
    address_line1: "1 rue du Louvre",
    address_city: "Paris",
    address_postalcode: "75000",
    address_country: "France",
  },
  from: {
    name: "John Doe",
    company: "My Company",
    address_line1: "1 rue du Louvre",
    address_city: "Paris",
    address_postalcode: "75000",
    address_country: "France",
  },
  color: "bw",
  postage_type: "prioritaire",
  source_file: '<html>Test</html>',
  source_file_type: "html",
  content: "My letter content",
  content_type: "text",
  variables: {
    nom: "wrapper variable test"
  }
})
.then((letter) => {
  console.log(letter);
})
.catch((err) => {
  console.log(err);
});