junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.58k stars 134 forks source link

How do you generate a token? #236

Closed ishaanbuildsthings closed 11 months ago

ishaanbuildsthings commented 11 months ago

Thanks for making this API,

I am trying to generate a token so I can be authenticated, and access private routes using my token + userID, as opposed to a user + pass. How do I generate this token? I saw that we use the login function call but I couldn't figure out how to get it working nor find documentation.

junhoyeo commented 11 months ago
const threadsAPI = new ThreadsAPI({
  username: '_junhoyeo', // Your username
  password: 'PASSWORD', // Your password
});

const token = await threadsAPI.getToken();
console.log(token);
console.log(threadsAPI.token);