/vanilla-sharing

Small simple tool for sharing url, title, description and image to VK, Facebook, OK, G+, Twitter and Mail

Primary LanguageJavaScriptMIT LicenseMIT

vanilla-sharing

Small simple tool for sharing url, title, description and image to VK, Facebook, OK, G+, Twitter and Mail

Build Status Build status Coverage Status npm npm David David

Installation

npm install --save vanilla-sharing

or

yard add vanilla-sharing

Usage

  1. From build folder. Include file build/vanilla-sharing.js to your project
VanillaSharing.vk(options);
  1. From ES6 modules.
import { vk } from 'vanilla-sharing';

vk(options);

API

vk(options)

Share to vk.com.

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

fb(options)

Share to facebook.com.

fb({
  url: string,
  title: string,
  description: string,
  image: string,
  redirectUri: string,
  fbAppId: string,
})

tw(options)

Share to Twitter.

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

ok(options)

Share to ok.ru.

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

mail(options)

Share to mail.ru.

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

telegram(options)

Share to Telegram.

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

viber(options)

Share to Viber. Share method from Viber Share Button.

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

whatsapp(options)

Share to Whatsapp. Share method from kriskbx/whatsapp-sharing.

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

gp(options)

Share to Google+.

gp({
  url: string,
})