Skip to content

Files

Latest commit

May 2, 2022
797123a · May 2, 2022

History

History
This branch is 1 commit ahead of, 4 commits behind xdevplatform/twitter-api-typescript-sdk:main.

examples

Twitter API TypeScript SDK Examples

To run the examples

Make sure you are in the examples directory

Install the required packages

npm install

Next, create a .env file in the example directory and populate the following variables (You do not need them all for each example, for example oauth2-bearer.ts only requires a BEARER_TOKEN):

BEARER_TOKEN=my-bearer-token
API_KEY=my-api-key
API_SECRET_KEY=my-secret-key
ACCESS_TOKEN=my-access-token
ACCESS_TOKEN_SECRET=my-access-token-secret

Run the example with ts-node

npx ts-node *.ts

For example:

npx ts-node oauth2-bearer.ts