How do I add a Share to Threads button to my website?
Asked Answered
T

3

13

Currently, Meta and Twitter provide ways to share a link to Facebook and Twitter from your website via a button the user can click on. How do I create a button for my users to share content to Instagram Threads?

Instagram documentation does not seem to include any details on sharing to threads.

Testerman answered 6/7, 2023 at 16:16 Comment(1)
There's no official docs yet. I know they are using graphql for getting profile information and getting tweets since you can inspect them through the website, but you can't tweet from the web yet. I'm sure you could use proxyman to figure that out though while using their appKlenk
E
4

Shareaholic Share Buttons supports Threads.

Threads offers the following deeplink on Android and iOS which can pre-populate a post with some text, which Shareaholic incorporates:

barcelona://create?text=[yourtext]

(In case you're wondering, "Project 92" and "Barcelona" were the internal codenames of the Threads project at Meta.)

On desktop:

https://threads.net/intent/post?text=[yourtext]

You can add Threads to your website with the following code:

<a href data-app="share_buttons" data-app-config='{"service":"threads"}'>Share</a>

(assuming shareaholic.js is included on the page)

Alternatively, add the following to any DOM element:

data-app="share_buttons" data-app-config='{"service":"threads"}'

You can experience the desktop and app endpoints for yourself here.

Threads Share Button

Example resulting post:

threads.net sharing

Epicotyl answered 20/12, 2023 at 16:49 Comment(0)
H
3

As of Jan 25, 2024, this is possible for all platforms.

Official Documentation for web intents

The link route is (Source) :

/intent/post?text={...}

Example from one of the Threads engineers (note URL-encoded):

https://www.threads.net/intent/post?text=https%3A%2F%2Fengineering.fb.com%2F2023%2F11%2F06%2Fandroid%2Fhow-meta-built-threads-in-5-months

For Apps specifically:

you can use a deep-link using:

barcelona://create?text=[yourtext]

They're also taking a look about incorporating the Web Share API.

You can use any of the above tools (AddToAny, Shareaholic, etc.), I'm sure there will be more in the coming weeks.

These two sites can generate ad-hoc links or profile badges with an Threads svg image for easy embedding.

Generates: https://www.threads.net/intent/post?text=Test%20post%0A%0Ahttps%3A%2F%2Fwww.stackoverflow.com

enter image description here

Handsome answered 26/1 at 15:29 Comment(0)
J
0

AddToAny has a Threads share button they announced on Threads.

I inspected the share button and found it uses a protocol code-named “barcelona” that takes the form:

barcelona://create?text=

So if you’re trying to share a link you need to URL encode it like this:

barcelona://create?text=Stack%20Overflow%20https%3A%2F%2Fstackoverflow.com%2F

Note that this only works for users who have the Android or iPhone app installed. There is no way to share to the web app until Threads has an HTTP URL for sharing.

It’s probably best to use AddToAny since the sharing URL for Threads will need to be updated when the HTTP URL comes online, and AddToAny should have that covered.

Here’s the “share to Threads” URL directly if you want to skip the JavaScript and roll your own share button:

https://www.addtoany.com/add_to/threads?linkurl=https%3A%2F%2Fstackoverflow.com%2F&linkname=Stack%20Overflow
Joaniejoann answered 23/12, 2023 at 3:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.