Threads access token.
Post text, or a ThreadsPostInput for media, replies and reply controls.
OptionalreplyToID: stringParent post id, to make this post a reply. Also settable on input.
Promise of the published post id, or null if any step failed (the API's error is logged).
import { createThreadsPost, MetaMediaType } from "naystack/socials";
await createThreadsPost(accessToken, "Hello from Naystack!");
await createThreadsPost(accessToken, {
text: "Campaign recap",
media: [
{ url: "https://cdn.example.com/1.jpg", type: MetaMediaType.Photo },
{ url: "https://cdn.example.com/2.mp4", type: MetaMediaType.Video },
],
});
Publishes to Threads — text, image, video or carousel, chosen from the media you pass. Creates the container, waits for Threads to finish processing it, then publishes.
Media URLs must be publicly reachable — Threads downloads them server-side.