Type aliases
AccountInfo
Account
Info
: { background
: string; category
: string; country
: string; eventTypes
: Delivered | Seen | Failed | ConversationStarted; icon
: string; id
: string; location
: { lat
: number; lon
: number }; members
: { avatar
: string; id
: string; name
: string; role
: string }[]; name
: string; subcategory
: string; subscribersCount
: number; uri
: string; webhook
: string }Type declaration
background: string
category: string
country: string
icon: string
id: string
location: { lat: number; lon: number }
members: { avatar: string; id: string; name: string; role: string }[]
name: string
subcategory: string
subscribersCount: number
uri: string
webhook: string
ClientConfig
Client
Config
: { accessToken
: string; onRequest
?: OnRequestFunction; origin
?: string; sender
: Sender }Type declaration
accessToken: string
Optional onRequest?: OnRequestFunction
Optional origin?: string
Contact
Contact: { name: string; phoneNumber: string }
Type declaration
name: string
phoneNumber: string
FailedResponseData
FailedResponseData<T>: ({ status: 1; statusMessage: "invalidUrl" } | { status: 2; statusMessage: "invalidAuthToken" } | { status: 3; statusMessage: "badData" } | { status: 4; statusMessage: "missingData" } | { status: 5; statusMessage: "receiverNotRegistered" } | { status: 6; statusMessage: "receiverNotSubscribed" } | { status: 7; statusMessage: "publicAccountBlocked" } | { status: 8; statusMessage: "publicAccountNotFound" } | { status: 9; statusMessage: "publicAccountSuspended" } | { status: 10; statusMessage: "webhookNotSet" } | { status: 11; statusMessage: "receiverNoSuitableDevice" } | { status: 12; statusMessage: "tooManyRequests" } | { status: 13; statusMessage: "apiVersionNotSupported" } | { status: 14; statusMessage: "incompatibleWithVersion" } | { status: 15; statusMessage: "publicAccountNotAuthorized" } | { status: 16; statusMessage: "inchatReplyMessageNotAllowed" } | { status: 17; statusMessage: "publicAccountIsNotInline" } | { status: 18; statusMessage: "noPublicChat" } | { status: 19; statusMessage: "cannotSendBroadcast" } | { status: 20; statusMessage: "broadcastNotAllowed" }) & T
Type parameters
File
File: { fileName: string; media: string; size: number }
Type declaration
fileName: string
media: string
size: number
Keyboard
Keyboard
: { bgColor
?: string; buttons
: KeyboardButton[]; buttonsGroupColumns
?: number; buttonsGroupRows
?: number; customDefaultHeight
?: number; defaultHeight
?: boolean; favoritesMetadata
?: any; heightScale
?: number; inputFieldState
?: "regular" | "minimized" | "hidden"; type
: "keyboard" }Type declaration
Optional bgColor?: string
Optional buttonsGroupColumns?: number
Optional buttonsGroupRows?: number
Optional customDefaultHeight?: number
Optional defaultHeight?: boolean
Optional favoritesMetadata?: any
Optional heightScale?: number
Optional inputFieldState?: "regular" | "minimized" | "hidden"
type: "keyboard"
KeyboardButton
Keyboard
Button
: { actionBody
: string; actionType
?: "reply" | "open-url" | "location-picker" | "share-phone" | "none"; bgColor
?: string; bgLoop
?: boolean; bgMedia
?: string; bgMediaScaleType
?: "crop" | "fill" | "fit"; bgMediaType
?: "picture" | "gif"; columns
?: number; frame
?: KeyboardButtonFrame; image
?: string; imageScaleType
?: "crop" | "fill" | "fit"; internalBrowser
?: KeyboardButtonInternalBrowser; map
?: KeyboardButtonMap; mediaPlayer
?: KeyboardButtonMediaPlayer; openURLMediaType
?: "not-media" | "video" | "gif" | "picture"; openURLType
?: "internal" | "external"; rows
?: number; silent
?: boolean; text
?: string; textBgGradientColor
?: string; textHAlign
?: "left" | "center" | "right"; textOpacity
?: number; textPaddings
?: [number, number, number, number]; textShouldFit
?: boolean; textSize
?: "small" | "regular" | "large"; textVAlign
?: "top" | "middle" | "bottom" }Type declaration
actionBody: string
Optional actionType?: "reply" | "open-url" | "location-picker" | "share-phone" | "none"
Optional bgColor?: string
Optional bgLoop?: boolean
Optional bgMedia?: string
Optional bgMediaScaleType?: "crop" | "fill" | "fit"
Optional bgMediaType?: "picture" | "gif"
Optional columns?: number
Optional image?: string
Optional imageScaleType?: "crop" | "fill" | "fit"
Optional openURLMediaType?: "not-media" | "video" | "gif" | "picture"
Optional openURLType?: "internal" | "external"
Optional rows?: number
Optional silent?: boolean
Optional text?: string
Optional textBgGradientColor?: string
Optional textHAlign?: "left" | "center" | "right"
Optional textOpacity?: number
Optional textPaddings?: [number, number, number, number]
Optional textShouldFit?: boolean
Optional textSize?: "small" | "regular" | "large"
Optional textVAlign?: "top" | "middle" | "bottom"
KeyboardButtonFrame
KeyboardButtonFrame: { borderColor?: string; borderWidth?: number; cornerRadius?: number }
Type declaration
Optional borderColor?: string
Optional borderWidth?: number
Optional cornerRadius?: number
KeyboardButtonInternalBrowser
KeyboardButtonInternalBrowser: { actionButton?: "forward" | "send" | "open-externally" | "send-to-bot" | "none"; actionPredefinedURL?: string; actionReplyData?: string; customTitle?: string; footerType?: "default" | "hidden"; mode?: "fullscreen" | "fullscreen-portrait" | "fullscreen-landscape" | "partial-size"; titleType?: "domain" | "default" }
Type declaration
Optional actionButton?: "forward" | "send" | "open-externally" | "send-to-bot" | "none"
Optional actionPredefinedURL?: string
Optional actionReplyData?: string
Optional customTitle?: string
Optional footerType?: "default" | "hidden"
Optional mode?: "fullscreen" | "fullscreen-portrait" | "fullscreen-landscape" | "partial-size"
Optional titleType?: "domain" | "default"
KeyboardButtonMap
KeyboardButtonMap: { latitude?: number; longitude?: number }
Type declaration
Optional latitude?: number
Optional longitude?: number
KeyboardButtonMediaPlayer
KeyboardButtonMediaPlayer: { loop?: boolean; subtitle?: string; thumbnailURL?: string; title?: string }
Type declaration
Optional loop?: boolean
Optional subtitle?: string
Optional thumbnailURL?: string
Optional title?: string
Location
Location: { lat: string; lon: string }
MessageOptions
Message
Options
: { keyboard
?: Keyboard; minApiVersion
?: number; sender
?: Sender; trackingData
?: string }Type declaration
Optional keyboard?: Keyboard
Optional minApiVersion?: number
Optional sender?: Sender
Optional trackingData?: string
Picture
Picture: { media: string; text: string; thumbnail?: string }
Type declaration
media: string
text: string
Optional thumbnail?: string
ResponseData
Type parameters
RichMedia
Rich
Media
: { bgColor
: string; buttons
: RichMediaButton[]; buttonsGroupColumns
: number; buttonsGroupRows
: number; type
: "rich_media" }Type declaration
bgColor: string
buttonsGroupColumns: number
buttonsGroupRows: number
type: "rich_media"
RichMediaButton
RichMediaButton: { actionBody: string; actionType: "open-url" | "reply"; columns: number; image?: string; rows: number; text?: string; textHAlign?: "left" | "middle" | "right"; textSize?: "small" | "medium" | "large"; textVAlign?: "middle" }
Type declaration
actionBody: string
actionType: "open-url" | "reply"
columns: number
Optional image?: string
rows: number
Optional text?: string
Optional textHAlign?: "left" | "middle" | "right"
Optional textSize?: "small" | "medium" | "large"
Optional textVAlign?: "middle"
Sender
Sender: { avatar?: string; name: string }
Type declaration
Optional avatar?: string
name: string
StickerMessage
Sticker
Message
: { stickerId
: number; type
: "sticker" } & MessageOptionsSucceededBroadcastResponseData
SucceededResponseData
SucceededResponseData<T>: { status: 0; statusMessage: "ok" } & T
Type parameters
UserDetails
UserDetails: { apiVersion: number; avatar: string; country: string; deviceType: string; id: string; language: string; mcc: number; mnc: number; name: string; primaryDeviceOs: string; viberVersion: string }
Type declaration
apiVersion: number
avatar: string
country: string
deviceType: string
id: string
language: string
mcc: number
mnc: number
name: string
primaryDeviceOs: string
viberVersion: string
UserOnlineStatus
UserOnlineStatus: { id: string; onlineStatus: 0 | 1 | 2 | 3 | 4; onlineStatusMessage: "online" }
Type declaration
id: string
onlineStatus: 0 | 1 | 2 | 3 | 4
onlineStatusMessage: "online"
Video
Video: { duration?: number; media: string; size: number; thumbnail?: string }
Type declaration
Optional duration?: number
media: string
size: number
Optional thumbnail?: string