twitter-lite
twitter-lite copied to clipboard
Update types to allow either app or user auth
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.