Social Sharing JavaScript API

How to use JavaScript to customize social sharing.