naystack - v1.9.9
    Preparing search index...
    • 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.

      Parameters

      • token: string

        Threads access token.

      • input: string | ThreadsPostInput

        Post text, or a ThreadsPostInput for media, replies and reply controls.

      • OptionalreplyToID: string

        Parent post id, to make this post a reply. Also settable on input.

      Returns Promise<string | null>

      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 },
      ],
      });