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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fibonalabs/just-communicate

v0.6.1

Published

Using npm:

Downloads

3

Readme

Installing

Using npm:

$ npm install @fibonalabs/just-communicate

Using yarn:

$ yarn add @fibonalabs/just-communicate

Usage

You can create a new instance of just-communicate.

import { create } from '@fibonalabs/just-communicate'

const notificationInstance = create({
    clientId: <CLIENT_ID>,
})

Email

notificationInstance.sendEmail({
    sender: string | string[],
    body: string,
    subject: string,
})

Push Notification

notificationInstance.sendPushNotification({
    sender: string | string[],
    title: string,
    body: string,
    target: 'token' | 'topic' | 'condition'
})

Send OTP

notificationInstance.sendOTP({
    sender: string,
    templateId: string,
})

Resend OTP

notificationInstance.resendOTP({
    sender: string,
    retryType: 'text' | 'voice',
})

Verify OTP

notificationInstance.verifyOTP({
    sender: string,
    otp: string,
})

SMS

notificationInstance.sendSMS({
    sender: string,
    templateId: string,
})

Configs

Just Communicate Config

| name | Type | Description | | | -------- | -------- | -------------------------------- | -------- | | clientId | string | - | required | | baseURL | string | Use Client ID instead of baseURL | optional |

Email

| name | Type | Description | | | ----------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -------- | | sender | string \| string[] | - | required | | data | {string:string} | - | optional | | body | string | - | required | | subject | string | The subject of the e-mail | required | | subjectData | {string:string} | - | optional | | cc | string \| Address \| Array<string \| Address> | Comma separated list or an array of recipients e-mail addresses that will appear on the Cc: field | optional | | bcc | string \| Address \| Array<string \| Address> | Comma separated list or an array of recipients e-mail addresses that will appear on the Bcc: field - | optional | | attachments | AttachmentType[] | An array of attachment objects- | optional |

Address

| name | Type | Description | | | ------- | -------- | ----------- | -------- | | name | string | - | required | | address | string | - | required |

AttachmentType

| name | Type | Description | | | ------------------ | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | | filename | string \| false | filename to be reported as the name of the attached file, use of unicode is allowed. If you do not want to use a filename, set this value as false, otherwise a filename is generated automatically | optional | | content | string | String, Buffer or a Stream contents for the attachments | optional | | href | string | an URL to the file (data uris are allowed as well) | optional | | httpHeaders | Headers | optional HTTP headers to pass on with the href request, eg. {authorization: "bearer ..."}attachments | optional | | contentType | string | optional content type for the attachment, if not set will be derived from the filename property | optional | | contentDisposition | 'attachment' \| 'inline' | optional content disposition type for the attachment, defaults to ‘attachment’ | optional | | cid | string | optional content id for using inline images in HTML message source. Using cid sets the default contentDisposition to 'inline' and moves the attachment into a multipart/related mime node, so use it only if you actually want to use this attachment as an embedded image | optional | | encoding | string | If set and content is string, then encodes the content to a Buffer using the specified encoding. Example values: base64, hex, binary etc. Useful if you want to use binary attachments in a JSON formatted e-mail object | optional | | headers | Headers | custom headers for the attachment node. Same usage as with message headers | optional | | raw | string | an optional value that overrides entire node content in the mime message. If used then all other options set for this node are ignored. | optional | | path | string | path to a file or an URL (data uris are allowed as well) if you want to stream the file instead of including it (better for larger attachments) | optional |

Push Notification

| name | Type | Description | | | ---------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | | sender | string \| string[] | - | required | | data | {string:string} | - | optional | | body | string | The notification's body text. | required | | title | string | The notification's title. | required | | target | 'token' \| 'topic' \| 'condition' | Registration token to send a message to. | required | | image | string | Contains the URL of an image that is going to be downloaded on the device and displayed in a notification.JPEG, PNG, BMP have full support across platforms.Animated GIF and video only work on iOS. WebP and HEIF have varying levels of support across platforms and platform versions. Android has 1MB image size limit. | optional | | android | AndroidConfig | Input only. Android specific options for messages sent through FCM connection server. | optional | | webpush | WebPushConfig | Input only. Webpush protocol options. | optional | | apns | ApnsConfig | Input only. Apple Push Notification Service specific options. | optional | | fcmOptions | FCMOptions | Input only. Template for FCM SDK feature options to use across all platforms. | optional |

AndroidConfig

Refer https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidConfig

WebPushConfig

Refer https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#WebpushConfig

ApnsConfig

Refer https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#ApnsConfig

Send SMS

| name | Type | Description | | | ------------- | ----------------------------- | -------------------- | -------- | | sender | string \| string[] | - | required | | data | {string:string} | - | optional | | recipientData | {[sender]: {string:string}} | Sender Specific Data | optional |