Fixes Meta's Threads metadata for sites like Discord, Telegram, etc.
Forked from milanmdev/fixthreads, with additional features for FzThreads.
- Improved metadata rendering for Threads links
- Mastodon-compatible metadata and ActivityPub-style responses
- Better video preview/player metadata
- Custom FzThreads favicon and provider icon metadata
When you send a threads.com or threads.net link, replace the domain with fzthreads.com and then send it. (im broke)
Build the image:
docker build -t fzthreads .Create your runtime folders, then put your private credentials in config/users.json:
mkdir -p config generated
cp config/users.example.json config/users.jsonRun the container:
docker run -d --name fzthreads \
-p 20061:20061 \
-e PORT=20061 \
-v "$(pwd)/config:/build/config:ro" \
-v "$(pwd)/generated:/build/generated" \
fzthreadsconfig/ is mounted read-only because the app only reads config/users.json.
generated/ is mounted writable so login/session tokens can persist across container restarts.
config/users.json is private. It can contain Threads/Instagram login cookies, a bearer token, or username/password credentials. Do not commit it or paste it into issues/logs.
The recommended format is cookie-based:
[
{
"username": "your_threads_username",
"cookies": {
"sessionid": "YOUR_SESSION_ID",
"csrftoken": "YOUR_CSRF_TOKEN",
"ds_user_id": "YOUR_USER_ID",
"mid": "YOUR_MID",
"ig_did": "YOUR_IG_DID"
}
}
]Quick DevTools Console method:
- Log in at
https://www.threads.com/. - Open DevTools, then open the Console tab.
- Paste this script. It copies a
config/users.jsontemplate to your clipboard.
(() => {
const wanted = new Set(["sessionid", "csrftoken", "ds_user_id", "mid", "ig_did"]);
const cookies = Object.fromEntries(
document.cookie
.split(";")
.map(part => part.trim())
.filter(Boolean)
.map(part => {
const index = part.indexOf("=");
return [part.slice(0, index), decodeURIComponent(part.slice(index + 1))];
})
.filter(([key, value]) => wanted.has(key) && value)
);
const config = [
{
username: "your_threads_username",
cookies,
},
];
copy(JSON.stringify(config, null, 2));
console.log("Copied config/users.json JSON to clipboard. Keep it private.");
})();If sessionid is missing, use the Network tab instead:
- Open DevTools, then open the Network tab.
- Refresh
https://www.threads.com/. - Click a request to
www.threads.com. - In Request Headers, copy the
Cookieheader. You can also right-click the request, choose Copy, then Copy as cURL, and copy the value from thecookie:header in that command. - Convert the
Cookieheader into thecookiesobject above. Keep at leastsessionid;csrftoken,ds_user_id,mid, andig_didare also useful.
Cookie header converter:
const cookieHeader = "PASTE_COOKIE_HEADER_HERE";
const wanted = new Set(["sessionid", "csrftoken", "ds_user_id", "mid", "ig_did"]);
const cookies = Object.fromEntries(
cookieHeader
.split(";")
.map(part => part.trim())
.filter(Boolean)
.map(part => {
const index = part.indexOf("=");
return [part.slice(0, index), decodeURIComponent(part.slice(index + 1))];
})
.filter(([key, value]) => wanted.has(key) && value)
);
copy(
JSON.stringify(
[
{
username: "your_threads_username",
cookies,
},
],
null,
2
)
);You can also use a bearer token instead:
[
{
"username": "your_threads_username",
"token": "Bearer IGT:2:YOUR_TOKEN"
}
]If you need support, feel free to join the Discord server.