Skip to content

Keep getting error code 401 #109

Answered by alkihis
MahoMuri asked this question in Q&A
Nov 18, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hello,

In theory, your code is correct.
Are you sure your bearer token is right and your ENV variable is correctly initialized?

Can you copy/paste the thrown error?

If you want more request info, you can add, at the beginning of your script:

import { TwitterApiV2Settings } from 'twitter-api-v2';
TwitterApiV2Settings.debug = true

It will print sent headers, authentification and request data.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MahoMuri
Comment options

Answer selected by alkihis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants