Skip to content

1.11.0 - Plugins

Compare
Choose a tag to compare
@alkihis alkihis released this 16 Feb 20:35
· 179 commits to master since this release
  • Feat: Support plugins (more features coming soon as plugins!)
  • Feat: Compression level can now be specified explicitly
  • Refactor: .v1.uploadMedia() now accept options.mimeType and options.longVideo as argument, in replacement of options.type
  • Fix: OAuth2 scope incorrectly encoded #184

BREAKING CHANGES:

  • settings.disableCompression (client settings on instantiation) is now settings.compression to allow more precise settings
  • client.send and client.sendStream are now private methods. Migrate to HTTP methods .get/.post/.getStream/...

DEPRECATIONS:

  • .v1.uploadMedia() argument options.type in now deprecated. Migration details available in v1 endpoint documentation of .uploadMedia.
    Migrate:

    await client.v1.uploadMedia(fs.openSync(jpgImg, 'r'), { type: 'jpg' })
    // - becomes -
    import { EUploadMimeType } from 'twitter-api-v2'
    await client.v1.uploadMedia(fs.openSync(jpgImg, 'r'), { mimeType: EUploadMimeType.Jpeg })

    if you're already using real MIME type in type, just change type to mimeType:

    await client.v1.uploadMedia(fs.openSync(jpgImg, 'r'), { type: 'image/jpeg' })
    // - becomes -
    await client.v1.uploadMedia(fs.openSync(jpgImg, 'r'), { mimeType: 'image/jpeg' })
  • Rate limit client methods .hasHitRateLimit/.isRateLimitStatusObsolete/.getLastRateLimitStatus are now deprecated. Migrate to plugin @twitter-api-v2/plugin-rate-limit