naystack - v1.5.10
    Preparing search index...
    • Fetches the authenticated user's Threads posts.

      Parameters

      • token: string

        Threads access token.

      • Optionalfields: string[]

        Optional array of field names. Default: ["text", "permalink", "username"].

      Returns Promise<T[] | undefined>

      Promise of an array of posts (typed as T[], defaults to ThreadsPost[]).

      import { getThreads } from "naystack/socials";

      const threads = await getThreads(accessToken);
      for (const thread of threads ?? []) {
      console.log(thread.text, thread.permalink);
      }