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 Run it with
quickstart.ts (or quickstart.mjs for JavaScript):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
UserPaginatorandPostPaginator - Streaming — Read real-time streams with
EventDrivenStream - Code samples — Runnable TypeScript examples