twitter-lite icon indicating copy to clipboard operation
twitter-lite copied to clipboard

Update types to allow either app or user auth

Open PascalHelbig opened this issue 5 years ago • 0 comments

Initializing a new client with App authentication creates an TypeScript error:

new Twitter({ bearer_token: 'abc' });
Argument of type '{ bearer_token: string; }' is not assignable to parameter of type 'TwitterOptions'.
  Type '{ bearer_token: string; }' is missing the following properties from type 'TwitterOptions': consumer_key, consumer_secret

With this PR TwitterOptions accepts either the fields for User authentication (consumer_key, consumer_secret, access_token_key, access_token_secret) or for App authentication (bearer_token) as described in the README.

PascalHelbig avatar Jun 18 '20 07:06 PascalHelbig