Other Action Segment Value Action
Segment
Value
: { accomplishRequest
: null | AccomplishRequestFn ; mediaSources
: null | MediaSource [] ; request
: TwitterApiRequest ; type
: "action" } Type declaration accomplish Request: null | AccomplishRequestFn media Sources: null | MediaSource [] type: "action" Animate Info Animate
Info
: { aspectRatio
: NumberPairs ; durationMs
: number ; variants
: { bitrate
: number ; contentType
: string ; url
: string } [] } Type declaration duration Ms: number variants: { bitrate: number ; contentType: string ; url: string } [] Coordinates Coordinates: { latitude: number ; longitude: number }
Type declaration latitude: number longitude: number Direct Message Segment Value Direct
Message
Segment
Value
: { accomplishRequest
: null | AccomplishRequestFn ; mediaSources
: null | MediaSource [] ; request
: TwitterApiRequest ; type
: "dm" } Type declaration accomplish Request: null | AccomplishRequestFn media Sources: null | MediaSource [] type: "dm" Fail Api Result Fail Api Result: { client_id?: string ; detail: string ; errors: any [] ; reason: string ; registration_url?: string ; required_enrollment?: string ; title: string ; type: string }
Type declaration Optional client_ id?: string detail: string errors: any [] reason: string Optional registration_ url?: string Optional required_ enrollment?: string title: string type: string File Media Source File Media Source: { assetTag?: string ; fileData: Buffer | NodeJS.ReadableStream ; parameters: {} ; type: "file" }
Type declaration Optional asset Tag?: string file Data: Buffer | NodeJS.ReadableStream parameters: {} [ k: string ]: undefined | string | number type: "file" Id Media Source Id Media Source: { id: string ; type: "id" }
Media Type declaration display Url: string download Url: string expanded Url: string id: string inline Url: string Optional source Status Id?: string Media Type Media Type: "photo" | "video" | "animated_gif"
Media Upload Result Media Upload Result: { expires_after_secs: number ; media_id: number | BigInt ; media_id_string: string ; processing_info?: { check_after_secs: number ; state: "pending" } ; size: number ; video?: { video_type: string } }
Type declaration expires_ after_ secs: number media_ id: number | BigInt media_ id_ string: string Optional processing_ info?: { check_after_secs: number ; state: "pending" } check_ after_ secs: number state: "pending" size: number Optional video?: { video_type: string } Mention Entity Mention
Entity
: { id
: string ; indices
: [ number , number ] ; name
: string ; screenName
: string ; user
: TwitterUser } Type declaration id: string indices: [ number , number ] name: string screen Name: string Number Pairs Number Pairs: [ number , number ]
Photo Photo
: Media & { type
: "photo" } Place Place
: { boundingCoordinates
: Coordinates [] ; country
: string ; countryCode
: string ; fullName
: string ; id
: string ; name
: string ; type
: string ; url
: string } Type declaration bounding Coordinates: Coordinates [] country: string country Code: string full Name: string id: string name: string type: string url: string Poll Entity Poll Entity: { durationMinutes: number ; endTime: Date ; options: { position: number ; text: string } [] }
Type declaration duration Minutes: number end Time: Date options: { position: number ; text: string } [] Raw Action Info Raw
Action
Info
: { created_timestamp
: number ; source
: RawUser ; target
: RawUser } Type declaration created_ timestamp: number Raw App Raw App: { id: string ; name: string ; url: string }
Type declaration id: string name: string url: string Raw Block Status Event Raw
Block
Status
Event
: { block_events
: ( { type
: "block" | "unblock" } & RawActionInfo ) [] ; for_user_id
: string } Type declaration block_ events: ( { type: "block" | "unblock" } & RawActionInfo ) [] for_ user_ id: string Raw Direct Message Raw
Direct
Message
: { created_timestamp
: string ; id
: string ; message_create
: { initiated_via
?: { tweet_id
?: string ; welcome_message_id
?: string } ; message_data
: { attachment
?: { media
: RawMedia ; type
: "media" } ; entities
: RawEntities ; quick_reply_response
?: { metadata
: string ; type
: "options" } ; text
: string } ; sender_id
: string ; source_app_id
: string ; target
: { recipient_id
: string } } ; type
: "message_create" } Type declaration created_ timestamp: string id: string message_ create: { initiated_via?: { tweet_id?: string ; welcome_message_id?: string } ; message_data: { attachment?: { media: RawMedia ; type: "media" } ; entities: RawEntities ; quick_reply_response?: { metadata: string ; type: "options" } ; text: string } ; sender_id: string ; source_app_id: string ; target: { recipient_id: string } } Optional initiated_ via?: { tweet_id?: string ; welcome_message_id?: string } Optional tweet_ id?: string Optional welcome_ message_ id?: string message_ data: { attachment?: { media: RawMedia ; type: "media" } ; entities: RawEntities ; quick_reply_response?: { metadata: string ; type: "options" } ; text: string } Optional attachment?: { media: RawMedia ; type: "media" } Optional quick_ reply_ response?: { metadata: string ; type: "options" } metadata: string type: "options" text: string sender_ id: string source_ app_ id: string target: { recipient_id: string } type: "message_create" Raw Direct Message Action Raw Direct Message Action: { created_timestamp: string ; sender_id: string ; target: { recipient_id: string } ; users: {} }
Type declaration created_ timestamp: string sender_ id: string target: { recipient_id: string } users: {} Raw Direct Message Event Raw
Direct
Message
Event
: { apps
: {} ; direct_message_events
: RawDirectMessage [] ; for_user_id
: string ; users
: {} } Type declaration apps: {} for_ user_ id: string users: {} Raw Direct Message Indicate Typing Event Raw
Direct
Message
Indicate
Typing
Event
: { direct_message_indicate_typing_events
: RawDirectMessageAction [] ; for_user_id
: string ; users
: {} } Type declaration for_ user_ id: string users: {} Raw Direct Message Mark Read Event Raw
Direct
Message
Mark
Read
Event
: { direct_message_mark_read_events
: RawDirectMessageMarkRead [] ; for_user_id
: string ; users
: {} } Type declaration for_ user_ id: string users: {} Raw Entities Raw
Entities
: { hashtags
: { indices
: NumberPairs ; text
: string } [] ; media
: RawMedia [] ; polls
?: { duration_minutes
: number ; end_datetime
: string ; options
: { position
: number ; text
: string } [] } [] ; symbols
: { indices
: NumberPairs ; text
: string } [] ; urls
: RawUrlEntity [] ; user_mentions
: { id
: number | BigInt ; id_str
: string ; indices
: NumberPairs ; name
: string ; screen_name
: string } [] } Type declaration hashtags: { indices: NumberPairs ; text: string } [] Optional polls?: { duration_minutes: number ; end_datetime: string ; options: { position: number ; text: string } [] } [] symbols: { indices: NumberPairs ; text: string } [] user_ mentions: { id: number | BigInt ; id_str: string ; indices: NumberPairs ; name: string ; screen_name: string } [] Raw Favorite Raw
Favorite
: { created_at
: string ; favorited_status
: RawTweet ; id
: string ; timestamp_ms
: number ; user
: RawUser } Type declaration created_ at: string favorited_ status: RawTweet id: string timestamp_ ms: number Raw Favorite Event Raw
Favorite
Event
: { favorite_events
: RawFavorite [] ; for_user_id
: string } Raw Follow Statue Event Raw
Follow
Statue
Event
: { follow_events
: ( { type
: "follow" | "unfollow" } & RawActionInfo ) [] ; for_user_id
: string } Type declaration follow_ events: ( { type: "follow" | "unfollow" } & RawActionInfo ) [] for_ user_ id: string Raw Media Raw
Media
: { additional_media_info
?: { description
: string ; embeddable
: boolean ; monetizable
: boolean ; title
: string } ; display_url
: string ; expanded_url
: string ; id
: number | BigInt ; id_str
: string ; indices
: NumberPairs ; media_url
: string ; media_url_https
: string ; sizes
: RawMediaSizeChoices ; source_status_id
?: number | BigInt ; source_status_id_str
?: string ; type
: MediaType ; url
: string ; video_info
?: { aspect_ratio
: NumberPairs ; duration_millis
: number ; variants
: { bitrate
: number ; content_type
: string ; url
: string } [] } } Type declaration Optional additional_ media_ info?: { description: string ; embeddable: boolean ; monetizable: boolean ; title: string } description: string embeddable: boolean monetizable: boolean title: string display_ url: string expanded_ url: string id: number | BigInt id_ str: string media_ url: string media_ url_ https: string Optional source_ status_ id?: number | BigInt Optional source_ status_ id_ str?: string url: string Optional video_ info?: { aspect_ratio: NumberPairs ; duration_millis: number ; variants: { bitrate: number ; content_type: string ; url: string } [] } duration_ millis: number variants: { bitrate: number ; content_type: string ; url: string } [] Raw Media Size Raw Media Size: { h: number ; resize: string ; w: number }
Type declaration h: number resize: string w: number Raw Mute Status Event Raw
Mute
Status
Event
: { for_user_id
: string ; mute_events
: ( { type
: "mute" | "unmute" } & RawActionInfo ) [] } Type declaration for_ user_ id: string mute_ events: ( { type: "mute" | "unmute" } & RawActionInfo ) [] Raw Place Raw
Place
: { attributes
?: {} ; bounding_box
: { coordinates
: NumberPairs [] ; type
: "Polygon" } ; country
: string ; country_code
: string ; full_name
: string ; id
: string ; name
: string ; place_type
: string ; url
: string } Type declaration Optional attributes?: {} bounding_ box: { coordinates: NumberPairs [] ; type: "Polygon" } country: string country_ code: string full_ name: string id: string name: string place_ type: string url: string Raw Settings Raw Settings: { allow_contributor_request: string ; always_use_https: boolean ; discoverable_by_email: boolean ; geo_enabled: boolean ; language: string ; protected: boolean ; screen_name: string ; show_all_inline_media: boolean ; sleep_time: { enabled: boolean ; end_time: null | number ; start_time: null | number } ; time_zone: { name: string ; tzinfo_name: string ; utc_offset: number } ; trend_location: [ { country: string ; countryCode: string ; name: string ; parentid: number ; placeType: { code: number ; name: number } ; url: string ; woeid: number } ] ; use_cookie_personalization: boolean }
Type declaration allow_ contributor_ request: string always_ use_ https: boolean discoverable_ by_ email: boolean geo_ enabled: boolean language: string protected: boolean screen_ name: string show_ all_ inline_ media: boolean sleep_ time: { enabled: boolean ; end_time: null | number ; start_time: null | number } enabled: boolean end_ time: null | number start_ time: null | number time_ zone: { name: string ; tzinfo_name: string ; utc_offset: number } name: string tzinfo_ name: string utc_ offset: number trend_ location: [ { country: string ; countryCode: string ; name: string ; parentid: number ; placeType: { code: number ; name: number } ; url: string ; woeid: number } ] use_ cookie_ personalization: boolean Raw Tweet Raw
Tweet
: { coordinates
?: { coordinates
: NumberPairs ; type
: "Point" } ; created_at
: string ; entities
: RawEntities ; extended_entities
: { media
: RawMedia [] } ; favorite_count
?: number ; favorited
: boolean ; filter_level
: string ; id
: number | BigInt ; id_str
: string ; in_reply_to_screen_name
?: string ; in_reply_to_status_id
?: number | BigInt ; in_reply_to_status_id_str
?: string ; in_reply_to_user_id
?: number | BigInt ; in_reply_to_user_id_str
?: string ; is_quote_status
: boolean ; lang
?: string ; place
?: RawPlace ; possibly_sensitive
?: boolean ; quote_count
?: number ; quoted_status
?: RawTweet ; quoted_status_id
: number | BigInt ; quoted_status_id_str
: string ; reply_count
: number ; retweet_count
: number ; retweeted
: boolean ; retweeted_status
?: RawTweet ; source
: string ; text
: string ; truncated
: boolean ; user
: RawUser } Type declaration Optional coordinates?: { coordinates: NumberPairs ; type: "Point" } created_ at: string extended_ entities: { media: RawMedia [] } Optional favorite_ count?: number favorited: boolean filter_ level: string id: number | BigInt id_ str: string Optional in_ reply_ to_ screen_ name?: string Optional in_ reply_ to_ status_ id?: number | BigInt Optional in_ reply_ to_ status_ id_ str?: string Optional in_ reply_ to_ user_ id?: number | BigInt Optional in_ reply_ to_ user_ id_ str?: string is_ quote_ status: boolean Optional lang?: string Optional place?: RawPlace Optional possibly_ sensitive?: boolean Optional quote_ count?: number Optional quoted_ status?: RawTweet quoted_ status_ id: number | BigInt quoted_ status_ id_ str: string reply_ count: number retweet_ count: number retweeted: boolean Optional retweeted_ status?: RawTweet source: string text: string truncated: boolean Raw Tweet Create Event Raw
Tweet
Create
Event
: { for_user_id
: string ; tweet_create_events
: RawTweet [] ; user_has_blocked
?: "true" | "false" } Type declaration for_ user_ id: string tweet_ create_ events: RawTweet [] Optional user_ has_ blocked?: "true" | "false" Raw Tweet Delete Raw Tweet Delete: { status: { id: string ; user_id: string } ; timestamp_ms: string }
Type declaration status: { id: string ; user_id: string } id: string user_ id: string timestamp_ ms: string Raw Tweet Delete Event Raw
Tweet
Delete
Event
: { for_user_id
: string ; tweet_delete_events
: RawTweetDelete [] } Raw Url Entity Raw
Url
Entity
: { display_url
: string ; expanded_url
: string ; indices
: NumberPairs ; url
: string } Type declaration display_ url: string expanded_ url: string url: string Raw User Raw
User
: { created_at
: string ; default_profile
: boolean ; default_profile_image
: boolean ; derived
?: { location
: {} } ; description
?: string ; entities
?: { description
: { urls
: RawUrlEntity [] } ; url
: { urls
: RawUrlEntity [] } } ; favourites_count
: number ; followers_count
: number ; friends_count
: number ; id
: number | BigInt ; id_str
: string ; listed_count
: number ; location
?: string ; name
: string ; profile_banner_url
: null | string ; profile_image_url_https
: string ; protected
: boolean ; screen_name
: string ; status
?: RawTweet ; statuses_count
: number ; url
?: string ; verified
: boolean ; withheld_in_countries
?: string [] ; withheld_scope
?: string } Type declaration created_ at: string default_ profile: boolean default_ profile_ image: boolean Optional derived?: { location: {} } Optional description?: string Optional entities?: { description: { urls: RawUrlEntity [] } ; url: { urls: RawUrlEntity [] } } favourites_ count: number followers_ count: number friends_ count: number id: number | BigInt id_ str: string listed_ count: number Optional location?: string name: string profile_ banner_ url: null | string profile_ image_ url_ https: string protected: boolean screen_ name: string Optional status?: RawTweet statuses_ count: number Optional url?: string verified: boolean Optional withheld_ in_ countries?: string [] Optional withheld_ scope?: string Raw User Revoke Event Raw User Revoke Event: { user_event: { revoke: { date_time: number ; source: { user_id: string } ; target: { app_id: string } } } }
Type declaration user_ event: { revoke: { date_time: number ; source: { user_id: string } ; target: { app_id: string } } } revoke: { date_time: number ; source: { user_id: string } ; target: { app_id: string } } date_ time: number source: { user_id: string } target: { app_id: string } Reply To Target Reply
To
Target
: { screenName
: string ; tweetId
: string ; user
: TwitterUser ; userId
: string } Type declaration screen Name: string tweet Id: string user Id: string Tweet Result Tweet Result: { data: { id: string ; text: string } }
Type declaration data: { id: string ; text: string } Tweet Segment Value Tweet
Segment
Value
: { accomplishRequest
: null | AccomplishRequestFn ; mediaSources
: null | MediaSource [] ; request
: TwitterApiRequest ; type
: "tweet" } Type declaration accomplish Request: null | AccomplishRequestFn media Sources: null | MediaSource [] type: "tweet" Twitter Api Request Twitter Api Request: { href: string ; method: string ; parameters: any }
Type declaration href: string method: string parameters: any Twitter Api Result Twitter
Api
Result
: { body
: unknown ; code
: number ; uploadedMedia
: null | { assetTag
: undefined | string ; result
: MediaUploadResult ; source
: MediaSource } [] } Twitter Component Type parameters Twitter Dispatch Middleware Twitter Event Context Type declaration event: TwitterEvent platform: "twitter" reply: function Twitter Job Type declaration accomplish Request: null | AccomplishRequestFn as Application: boolean key: undefined | string media Sources: null | MediaSource [] refresh Target: null | ( ( currentTarget: TwitterChannel , result: unknown ) => null | TwitterChannel ) Twitter Platform Configs Twitter
Platform
Configs
: { accessSecret
: string ; accessToken
: string ; appId
: string ; appKey
: string ; appSecret
: string ; bearerToken
: string ; dispatchMiddlewares
?: TwitterDispatchMiddleware [] ; eventMiddlewares
?: TwitterEventMiddleware [] ; maxRequestConnections
?: number ; shouldVerifyRequest
?: boolean ; webhookPath
?: string } Type declaration access Secret: string access Token: string app Id: string app Key: string app Secret: string bearer Token: string Optional max Request Connections?: number Optional should Verify Request?: boolean Optional webhook Path?: string Url Entity Url
Entity
: { displayUrl
: string ; expandedUrl
: string ; indices
: NumberPairs ; url
: string } Type declaration display Url: string expanded Url: string url: string Url Media Source Url Media Source: { assetTag?: string ; parameters: {} ; type: "url" ; url: string }
Type declaration Optional asset Tag?: string parameters: {} [ k: string ]: undefined | string | number type: "url" url: string Video Video
: Media & { additionalMediaInfo
: null | { description
: string ; embeddable
: boolean ; monetizable
: boolean ; title
: string } ; type
: "video" ; videoInfo
: null | AnimateInfo }
Twitter Platform
Tweeting and direct messaging on Twitter.
Install
Docs
Check the platform document and the package reference.
Setup