Skip to content

Small (1.1 KB) simple tool for sharing url, title, description and image to VK, Facebook (Feed, Dialog, Button, Messenger), Twitter, G+, VK, OK, Mail.ru, LinkedIn, Whatsapp, Viber, Telegram, Line.

License

Notifications You must be signed in to change notification settings

hyoungopb/vanilla-sharing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vanilla Sharing

vanilla-sharing

Small (1.1 KB) simple tool for sharing url, title, description and image to VK, Facebook (Feed, Dialog, Button, Messenger), Twitter, G+, VK, OK, Mail.ru, LinkedIn, Whatsapp, Viber, Telegram, Line.

DEMO

Build Status Coverage Status npm npm David David

Motivation

TODO

Installation

From NPM

npm install --save vanilla-sharing

From unpkg CDN (you can use other)

<script src="https://unpkg.com/vanilla-sharing"></script>

Usage

From NPM

import { fbButton } from 'vanilla-sharing';

fbButton({
  url: 'https://alexey-avdeev.com/vanilla-sharing/',
});

From CDN

VanillaSharing.fbButton({
  url: 'https://alexey-avdeev.com/vanilla-sharing/',
});

API

fbFeed(options)

Share on facebook.com via the Feed dialog

Documentation: https://developers.facebook.com/docs/sharing/reference/feed-dialog

fbFeed({
  url: string,
  redirectUri: string,
  fbAppId: string,
})

fbShare(options)

Share on facebook.com via the Share dialog

Documentation: https://developers.facebook.com/docs/sharing/reference/share-dialog

fbShare({
  url: string,
  redirectUri: string,
  hashtag: string,
  fbAppId: string,
})

fbButton(options)

Share on facebook.com using facebook share button

fbButton({
  url: string,
})

messenger(options)

Share via Facebook Messenger

Share method from Sharing for Messenger.

messenger({
  url: string,
  fbAppId: string,
})

tw(options)

Share on Twitter

tw({
  url: string,
  title: string,
})

reddit(options)

Share on Reddit

reddit({
  url: string
})

gp(options)

Share on Google+

gp({
  url: string,
})

vk(options)

Share on vk.com

vk({
  url: string,
  title: string,
  description: string,
  image: string,
  isVkParse: boolean,
})

ok(options)

Share on ok.ru

ok({
  url: string,
  title: string,
})

mail(options)

Share on Mail.ru

mail({
  url: string,
  title: string,
  description: string,
  image: string,
})

email(options)

Share via user's email

mail({
  url: string,
  title: string,
  description: string
})

### `linkedin(options)`

Share on LinkedIn

Share method from [Share on LinkedIn](https://developer.linkedin.com/docs/share-on-linkedin#).

```js
linkedin({
  url: string,
  title: string,
  description: string,
})

whatsapp(options)

Share via Whatsapp

WhatsApp FAQ - Using Click to Chat.

whatsapp({
  url: string,
  title: string,
  phone: string,
})

viber(options)

Share via Viber

Viber Share Button docs.

viber({
  url: string,
  title: string,
})

telegram(options)

Share via Telegram

telegram({
  url: string,
  title: string,
})

line(options)

Share via Line

line({
  url: string,
  title: string,
})

About

Small (1.1 KB) simple tool for sharing url, title, description and image to VK, Facebook (Feed, Dialog, Button, Messenger), Twitter, G+, VK, OK, Mail.ru, LinkedIn, Whatsapp, Viber, Telegram, Line.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%