twitter-api-typescript-sdk icon indicating copy to clipboard operation
twitter-api-typescript-sdk copied to clipboard

Is there any official documentation for this SDK?

Open shinshin86 opened this issue 3 years ago • 5 comments

Hello! May I know if there is any documentation for the SDK provided in this repository?

When I wrote a process using this SDK, I implemented it by looking at the source code here, but I would like to refer to the documentation as well if it is provided.

shinshin86 avatar Jul 22 '22 11:07 shinshin86

I support this request. I'm noticing that despite the examples/ showing an OAuth2 flow within a nodejs process, the SDK is designed to function within a single-session browser app. For instance, the authClient cannot be recreated from an existing accessToken or refreshToken, it can only be persisted from a redirect response. If the user sends its credentials as a JWT over cookie to the backend, the backend cannot recreate a client despite having the full token available.

mathieuhelie avatar Aug 03 '22 20:08 mathieuhelie

This is an issue for me too! There is no way to recreate authClient. Just submitted an issue to this effect, it should really be as simple as creating a setToken method.

tevonsb avatar Aug 16 '22 18:08 tevonsb

I just assign authClient.token. It works. But yeah, there must be a better way.

rojvv avatar Aug 16 '22 18:08 rojvv

I am also having this issue right now. I am trying to use this package in a Next.JS app and I am running into some issues. Does anyone have any updates/fixes here? I am able to get this to work by using a Singleton class, however it only works in production mode :/

jacklynch00 avatar Dec 06 '22 01:12 jacklynch00

I just assign authClient.token. It works. But yeah, there must be a better way.

I tried this but could not get it working. setting the authClient.token = { access_token: foo, refresh_token: bar } and then calling the authClient.refreshAccessToken() throws me an error.

ugglr avatar Dec 06 '22 06:12 ugglr