xdevplatform / twitter-api-typescript-sdk

A TypeScript SDK for the Twitter API

Home Page:https://developer.twitter.com/en/docs/twitter-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there any official documentation for this SDK?

shinshin86 opened this issue · 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.

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.

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.

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

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 :/

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.