naystack - v1.9.9
    Preparing search index...

    Module socials

    Socials module: publish to and read from Instagram and Threads; read from YouTube.

    Each platform exposes one publishing method — createInstagramPost, createThreadsPost — that picks the right media type from what you pass. The container/publish steps underneath are an implementation detail.

    Layout: socials/meta/ is the Graph protocol Instagram and Threads share; each platform gets its own folder. A platform on a different API brings its own client and exposes its own create<Platform>Post.

    Reading is normalized where publishing is not. Every platform's OAuth, profile and content endpoints collapse onto one SocialProvider shape — see InstagramProvider, YouTubeProvider — so a consumer stores one row shape per connected account whatever the platform. Publishing stays per-platform on purpose: the inputs diverge too far (text-only posts, stories, carousels, reply controls) for a shared signature to describe honestly.

    Anything this module doesn't wrap is still reachable: getInstagramData and getThreadsData call the Graph API directly with the base URL and version already pinned, so a one-off endpoint needs no new helper here.

    import { createInstagramPost, MetaMediaType } from "naystack/socials";

    await createInstagramPost(token, {
    caption: "New campaign is live 🎉",
    media: { url: "https://cdn.example.com/promo.mp4", type: MetaMediaType.Video },
    });

    References

    canPublishToInstagram → canPublishToInstagram
    createInstagramPost → createInstagramPost
    createThread → createThread
    createThreadsPost → createThreadsPost
    exchangeYouTubeCode → exchangeYouTubeCode
    getInstagramAuthorizationURL → getInstagramAuthorizationURL
    getInstagramConversation → getInstagramConversation
    getInstagramConversationByUser → getInstagramConversationByUser
    getInstagramConversations → getInstagramConversations
    getInstagramConversationsByUser → getInstagramConversationsByUser
    getInstagramData → getInstagramData
    getInstagramMedia → getInstagramMedia
    getInstagramMessage → getInstagramMessage
    getInstagramUser → getInstagramUser
    getLongLivedInstagramToken → getLongLivedInstagramToken
    getThread → getThread
    getThreads → getThreads
    getThreadsData → getThreadsData
    getThreadsReplies → getThreadsReplies
    getYouTubeAuthorizationURL → getYouTubeAuthorizationURL
    getYouTubeChannel → getYouTubeChannel
    getYouTubeUploads → getYouTubeUploads
    GraphClient → GraphClient
    GraphError → GraphError
    GraphParams → GraphParams
    GraphRequestOptions → GraphRequestOptions
    InstagramConversation → InstagramConversation
    InstagramMedia → InstagramMedia
    InstagramMessage → InstagramMessage
    InstagramPostInput → InstagramPostInput
    InstagramPostMedia → InstagramPostMedia
    InstagramProvider → InstagramProvider
    InstagramScope → InstagramScope
    InstagramUser → InstagramUser
    MetaMediaType → MetaMediaType
    PollOptions → PollOptions
    pollUntilReady → pollUntilReady
    readGraphID → readGraphID
    refreshInstagramAccessToken → refreshInstagramAccessToken
    refreshYouTubeToken → refreshYouTubeToken
    replyToInstagramComment → replyToInstagramComment
    RetryOptions → RetryOptions
    sendInstagramMessage → sendInstagramMessage
    setupInstagramWebhook → setupInstagramWebhook
    setupSocialAuth → setupSocialAuth
    SetupSocialAuthOptions → SetupSocialAuthOptions
    setupThreadsWebhook → setupThreadsWebhook
    SocialConnection → SocialConnection
    SocialProvider → SocialProvider
    ThreadsPost → ThreadsPost
    ThreadsPostInput → ThreadsPostInput
    ThreadsPostMedia → ThreadsPostMedia
    WaitForContainerOptions → WaitForContainerOptions
    withRetry → withRetry
    YouTubeProvider → YouTubeProvider
    YouTubeScope → YouTubeScope