title: LinkedIn share callback Javascript SDK/API v2
body: <p>I am trying to share content through the LinkedIn JavaScript SDK. But LinkedIn just updated their API and I cannot figure out how to: share a URL inside a popup and get a callback on a successful share.</p>
  
  <p>With the old LinkedIn share plugin you had something like this:</p>
  
  <p><a href="https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/plugins/share-plugin" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/plugins/share-plugin</a> </p>
  
  <pre><code>&lt;script src="//platform.linkedin.com/in.js" type="text/javascript"&gt;lang: en_US&lt;/script&gt;
  &lt;script type="IN/Share" data-url="https://www.linkedin.com"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>But it had an on-success attribute (this doesn't work anymore).</p>
  
  <p>I also thought of some work around like checking if there is a +1 to the share counter. But the counter is also deprecated. Another workaround could be checking when the share popup closes. But then the user can just close it, and they shared 'successfully'.</p>