Create a Facebook share url with ease
$ yarn add share-facebook
const shareFacebook = require('share-facebook')
shareFacebook({
quote: 'Check this library to help you create share facebook url',
href: 'https://bukinoshita.io',
redirect_uri: 'https://bukinoshita.io',
app_id: 'APP_ID'
})
// https://www.facebook.com/dialog/share?app_id=APP_ID&redirect_uri=https://bukinoshita.io&display=page"e=Check%20this%20library%20to%20help%20you%20create%20share%20facebook%20url
Check the examples
Returns a string
Type: string
Example: APP_ID
Required
Your app's unique identifier.
Type: string
Example: https://bukinoshita.io
Required
The URL to redirect to after a person clicks a button on the dialog. Required when using URL redirection.
Type: string
Default: page
Example: page
Determines how the dialog is rendered.
page
.iframe
type for people logged into your app or async
when using within a game on Facebook.com, and a popup
window for everyone else. You can also force the popup
type when when you use the Facebook SDK for JavaScript, if necessary.touch
display type.Type: string
Example: https://bukinoshita.io
The link attached to this post. Required when using method share
. Include open graph meta tags in the page at this URL to customize the story that is shared.
Type: string
Example: #facebook
A hashtag specified by the developer to be added to the shared content. People will still have the opportunity to remove this hashtag in the dialog. The hashtag should include the hash symbol.
Type: string
Example: share with FB
A quote to be shared along with the link, either highlighted by the user or predefined by the developer, as in a pull quote on an article.
Type: boolean
Default: false
Example: true
If set to true the share button will open the share dialog in an iframe on top of your website (For more information see Mobile Web Share Dialog. This option is only available for mobile, not desktop.
MIT © Bu Kinoshita