Share Dialog

The Share dialog gives people the ability to publish an individual story to their timeline, a friend's timeline, a group, or in a private message on Messenger. This does not require Facebook Login or any extended permissions, so it is the easiest way to enable sharing on the web.

If people are in a browser that is not logged in with a cookie, the drop-down list for choosing the audience for your share doesn't appear. This is also true if the app uses the feed dialog instead of the share dialog or if the app uses iframe web view.

To implement the Share Dialog in native mobile apps read our guides for iOS and Android.


The Share dialog is available in the Facebook SDK for JavaScript. You can use the following code snippet to trigger the Share dialog. You can also use a redirect to a URL. For details, see Advanced Topics.

Facebook SDK for JavaScript

Trigger a Share Dialog using the FB.ui function with the share method parameter to share a link.

To share a link:

  method: 'share',
  href: '',
}, function(response){});
Try it yourself!

Include open graph meta tags on the page at this URL to customize the story that is shared back to Facebook.

Note that response.error_message will appear only if someone using your app has authenciated your app with Facebook Login.


Common Parameters

The JS SDK will provide these parameters automatically.

Parameter Description


Your app's unique identifier. Required.


The URL to redirect to after a person clicks a button on the dialog. Required when using URL redirection.


Determines how the dialog is rendered.

  • If you are using the URL redirect dialog implementation, then this will be a full page display, shown within This display type is called page.
  • If you are using the Facebook SDK for iOS or Android to invoke the dialog, this is automatically specified and chooses an appropriate display type for the device.
  • If you are using the Facebook SDK for JavaScript, this defaults to a modal iframe type for people logged into your app or async when using within a game on, 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.
  • Mobile web apps always default to the touch display type.

share Parameters

Parameter Description Default


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.

Current URL


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, e.g. #facebook.



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.
This parameter is not available for Facebook URLs.




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.false

Response Data

Parameter Description


Only available if the user is logged into your app using Facebook Login.

Advanced Topics

You can also take advantage of the following advanced features.

URL Redirection

To share a link:

Note: When testing this code, remove the line breaks. Otherwise you will run into an error.