Skip to main content
1

Install the package

2

Export your Bearer Token

Generate a Bearer Token in the X Developer Console and set it in your shell:
3

Run your first script

Save this as quickstart.ts (or quickstart.mjs for JavaScript):
Run it with npx tsx quickstart.ts or node quickstart.mjs.

Next steps

  • Authentication — Bearer Token, OAuth 2.0 PKCE, and OAuth 1.0a
  • Pagination — Page through results with UserPaginator and PostPaginator
  • Streaming — Read real-time streams with EventDrivenStream
  • Code samples — Runnable TypeScript examples