Socket
Socket
Sign inDemoInstall

twitter-api-fetch

Package Overview
Dependencies
6
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    twitter-api-fetch

node-fetch for Twitter API


Version published
Weekly downloads
43
decreased by-12.24%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

twitter-fetch

codecov Tests

twitter-fetch is a Node.js library for accessing the Twitter API.

It has a fetch-like implementation based on node-fetch.

Installation

npm i twitter-fetch

# Yarn
yarn add twitter-fetch

# pnpm
pnpm i twitter-fetch

Usage

import { OAuth1a } from 'twitter-fetch'

const client = new OAuth1a({
  accessToken: 'your access token',
  consumerKey: 'your consumer key',
  secretAccessToken: 'your secret access token',
  secretConsumerKey: 'your secret consumer key',
})

const response = await fetch(
  `/1.1/statuses/update.json?status=${encodeURIComponent('Hello World')}`,
  { method: 'POST' }
)

console.log(await response.json())

Supports

  • Authentication
    • OAuth 1.0a User Context
    • OAuth 2.0 Authorization Code Flow with PKCE
    • App only
    • Basic authentication

Keywords

FAQs

Last updated on 28 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc