Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with client.v2.tweet Function Not Returning Response and Freezing Server #497

Open
sampatsharma143 opened this issue Aug 24, 2023 · 1 comment

Comments

@sampatsharma143
Copy link

I'm encountering an issue with the client.v2.tweet function from the Twitter API library within supabase cloud functions. The problem is that when I use this function to post a tweet, it doesn't seem to return a response as expected, and it leads to the server becoming unresponsive or freezing. but it does post the tweet to my twitter account.

code

const client = userClient.readWrite;
try{
  const postTweet = await client.v2.tweet({text:tweetText});
  // console.log(postTweet )
  return new Response(
    JSON.stringify({
      message: postTweet,
    }),
    { headers: { "Content-Type": "application/json" }, status: 200, },
  );
}catch(e){
  const error = {
    message: e,
  };
  
  return new Response(
    JSON.stringify(error),
    { headers: { "Content-Type": "application/json" },status:300 },
  );
}

Please let me know if there are any suggestions or potential solutions to resolve this issue. Your assistance is greatly appreciated.

@reyou
Copy link

reyou commented Sep 2, 2023

I am getting following error on my free account

 data: {
        title: 'Unsupported Authentication',
        detail: 'Authenticating with OAuth 2.0 Application-Only is forbidden for this endpoint.  Supported authentication types are [OAuth 1.0a User Context, OAuth 2.0 User Context].',
        type: 'https://api.twitter.com/2/problems/unsupported-authentication',
        status: 403
      }

Do you have free or paid account?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants