1.0.5 • Published 11 months ago

@mikmik1011/threads-api-wrapper v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

threads-api-wrapper : a NodeJS SDK for Threads API

GitHub package.json version npm npm GitHub

A SDK in Javascript / Typescript for the Threads API

!WARNING This project is work in progress and contributions are very welcome!

It is in early development and is not yet ready for production use.

Installation

npm install threads-api-wrapper

Usage

import ThreadsSDK from 'threads-api-wrapper';

const threadsApi = new ThreadsSDK();

const url = threadsApi.getAuthorizationUrl({
    clientId: '<your_client_id>',
    redirectUri: '<your_redirect_uri>',
    scopes: ['<your_scope>'],
});

User

/**
 * Retrieve profile information about a user on Threads.
 * @param params
 * @returns
 */
getUserProfile: (params: GetProfileParams) => Promise<ProfileResponse>;

/**
 * Retrieve a paginated list of all Threads posts created by a user.
 * @param params
 * @returns
 */
getUserThreads: (params: GetThreadsParams) => Promise<UserThreadsResponse>;

/**
 * Retrieve a paginated list of all Threads replies created by a user.
 * @param params
 * @returns
 */
getUserReplies: (params: GetThreadsParams) => Promise<UserRepliesResponse>;

/**
 * Check the app user's current publishing rate limit usage.
 * @param params
 * @returns
 */
getUserPublishingLimit: (params: GetPublishingLimitParams) => Promise<PublishingLimitResponse>;

Post

/**
 * Retrieve information about a media object or a thread on Threads.
 * @param params
 * @returns
 */
getMediaObject: (params: GetMediaParams): => Promise<ThreadData>;

Insights

/**
 * Retrieve insights for a Threads user object.
 * @param params
 * @returns
 */
getUserInsights: (params: GetUserInsightsParams) => Promise<UserInsightsResponse>;
/**
 * Retrieve insights for a Threads media object.
 * @param params
 * @returns
 */
getMediaInsights: (params: GetMediaInsightsParams) => Promise<MediaInsightsResponse>;

Maintainers

twitter/mikescopsthreads/mikmik_1011
Corentin MorsMisa Stefanovic
1.0.5

11 months ago

1.0.4

11 months ago