javascript – Trying to display number of Twitter followers in a React app

I’ve been trying to get a React page to display the number of Twitter followers for an account.

Twitter will only give me key, secret and bearer token so a lot of previously written methods seem to be out of date, but even some previous answers seem not to work for me. For example I tried

    import React, { Component } from 'react';

function Twitter () {
“, {
        headers: {
            Authorization: "Bearer <token>"
  let followerCount = user.fields.public_metrics.follower_count;
return followerCount;

export default Twitter;

In theory, this should feed the number to the next React component, but instead throws an error at the first quote mark.

At a loss as to how to achieve this now, open to trying to incorporate some npm packages but I thought it would be straightforward to display one number!