UNPKG

naystack

Version:

A stack built with tight Next + Drizzle + GraphQL

14 lines (13 loc) 440 B
// src/socials/threads/utils.ts function getThreadsURL(token, path, params) { return `https://graph.threads.net/v1.0/${path}?${Object.keys(params).map((key) => `${key}=${params[key]}`).join("&")}&access_token=${token}`; } function getThreadsData(token, path, params, method) { return fetch(getThreadsURL(token, path, params), { method: method || "GET" }).then((res) => res.json()); } export { getThreadsData, getThreadsURL };