Last active
May 25, 2024 05:53
-
-
Save creuserr/976efab18a0b16c87e1279b92e8ede5f to your computer and use it in GitHub Desktop.
check if a github user follows a specific user by its personal access token
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function isFollowing(token, username) { | |
const req = await fetch(`https://api.github.com/user/following/${username}`, { | |
headers: { | |
authorization: `Bearer ${token}` | |
} | |
}); | |
return req.status == 204; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment