npm

@37bytes/social-media-sharing
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

social-media-sharing

Provides a set of functions which open a new tab with social media sharing modal or a proper application window. Currently provides such functions for VK (VKontakte) and WhatsApp social medias.


shareVk

A simple function that opens a new tab with a VK (VKontakte) social media sharing modal.

Usage

The function accepts an object with url, title, and image passed as strings.
The url field is the only mandatory field. It safely opens a new tab with a VK sharing modal window when called.

import { shareVk } from "@37bytes/social-media-sharing";

shareVk({
    url: "https://example.com",
    title: "Title ",
    image: "https://some-site.com/some-picture.jpg",
  });

shareWhatsApp

A simple function that opens a new tab (an application window) with a WhatsApp sharing message.

Usage

The function accepts an object with url and title passed as strings.
The url field is the only mandatory field. It safely opens a new tab (an application window) with a WhatsApp sharing message when called.

import { shareWhatsApp } from "@37bytes/social-media-sharing";

shareWhatsApp({
    url: "https://example.com",
    title: "Title "
  });

Package Sidebar

Install

npm i @37bytes/social-media-sharing

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

10.4 kB

Total Files

8

Last publish

Collaborators

  • arhonist-37b
  • rispaev
  • yar_vav
  • rteslenko
  • tnikolaeva
  • dc.nikolaev
  • mgarmash