Skip to content

Migration Guide: Client → LineBotClient

The legacy Client class is deprecated. Use LineBotClient instead. The legacy OAuth class is deprecated. Use channelAccessToken.ChannelAccessTokenClient instead.

LineBotClient wraps the Messaging, Insight, LIFF, Audience, Shop, and Module API categories. Channel Access Token (OAuth) operations are handled by the separate channelAccessToken.ChannelAccessTokenClient.


Migration procedure

Step 1: Upgrade to v10.8.0

Update @line/bot-sdk to v10.8.0

sh
npm install --ignore-scripts @line/bot-sdk@10.8.0 # just in case

Both the legacy Client/OAuth API and the new LineBotClient API coexist in v10, so you can migrate incrementally without breaking existing code.

Step 2: Replace client construction

js
// Before
const { Client, OAuth } = require('@line/bot-sdk');
const client = new Client({ channelAccessToken: '...' });
const oauth  = new OAuth();

// After
const { LineBotClient, channelAccessToken } = require('@line/bot-sdk');
const client = LineBotClient.fromChannelAccessToken({ channelAccessToken: '...' });
const oauthClient = new channelAccessToken.ChannelAccessTokenClient({});

The channelAccessToken option is the same. Additional options available on LineBotClientChannelAccessTokenConfig:

OptionDefaultDescription
channelAccessTokenrequiredBearer token sent as Authorization header
defaultHeaders{}Extra headers merged into every request
apiBaseURLhttps://api.line.meOverride for api.line.me endpoints
dataApiBaseURLhttps://api-data.line.meOverride for api-data.line.me endpoints
managerBaseURLhttps://manager.line.bizOverride for manager.line.biz endpoints

httpConfig is not available in LineBotClient. The legacy ClientConfig accepted httpConfig?: Partial<AxiosRequestConfig> to customise timeout, proxy, and other axios-specific settings. LineBotClient uses the runtime's native fetch() internally, so there is no direct equivalent. defaultHeaders and the base-URL overrides above are still supported. If you relied on other axios options (e.g. timeout, proxy), you will need to configure them at the environment or runtime level (e.g. node --experimental-fetch, a custom fetch wrapper, or environment-level proxy settings).

Step 3: Update method calls

See the method mapping tables below. Most method signatures change: positional arguments are now collected into a single request object, e.g.:

js
// Before
await client.pushMessage(to, messages, notificationDisabled);

// After
await client.pushMessage({ to, messages, notificationDisabled });

Step 4: Update error handling

LineBotClient uses the Fetch API internally and throws HTTPFetchError on non-2xx responses. The legacy Client used axios and threw HTTPError. See the error handling section below.

Step 5: Update TypeScript types

Types in lib/types.ts are deprecated. Replace them with the generated types exported from the sub-namespaces. See the type mapping table below.

Step 6: Upgrade to v11

Once all usages of the legacy API have been removed, upgrade to v11 which drops the deprecated Client, OAuth, and related types entirely:

sh
npm install @line/bot-sdk@11

Error handling

The legacy Client uses axios internally and throws HTTPError (which wraps the axios error). LineBotClient uses the runtime's native fetch() and throws HTTPFetchError instead. The version of the package does not affect this — the difference is purely which client you use.

ts
// Before (legacy Client — axios-based)
import { HTTPError } from '@line/bot-sdk';

try {
  await client.pushMessage(to, messages);
} catch (err) {
  if (err instanceof HTTPError) {
    console.error(err.originalError.response.status);
    console.error(err.originalError.response.headers.get('x-line-request-id'));
    console.error(err.originalError.response.data); // parsed JSON
  }
}

// After (LineBotClient — fetch-based)
import { HTTPFetchError } from '@line/bot-sdk';

try {
  await client.pushMessage({ to, messages });
} catch (err) {
  if (err instanceof HTTPFetchError) {
    console.error(err.status);
    console.error(err.headers.get('x-line-request-id'));
    console.error(err.body); // raw string — JSON.parse() if needed
  }
}
HTTPError (v8)HTTPFetchError (v9+)Notes
originalError.response.statusstatus
originalError.response.headersheadersNow a Fetch Headers object
originalError.response.databodyWas parsed JSON; now a raw string
originalErrordeleted

SignatureValidationFailed is unchanged. In the normal LineBotClient fetch path, invalid JSON surfaces as a native SyntaxError rather than JSONParseError. JSONParseError is only thrown in legacy/helper paths that use ensureJSON().


Method mapping: Client → LineBotClient

Messaging

Client methodLineBotClient methodNotes
pushMessage(to, messages, notificationDisabled?, customAggregationUnits?)pushMessage({ to, messages, notificationDisabled, customAggregationUnits }, xLineRetryKey?)Arguments wrapped in a request object. Retry key moved to 2nd param.
replyMessage(replyToken, messages, notificationDisabled?)replyMessage({ replyToken, messages, notificationDisabled })Arguments wrapped in a request object.
multicast(to, messages, notificationDisabled?, customAggregationUnits?)multicast({ to, messages, notificationDisabled, customAggregationUnits }, xLineRetryKey?)Arguments wrapped in a request object. Retry key moved to 2nd param.
narrowcast(messages, recipient?, filter?, limit?, notificationDisabled?)narrowcast({ messages, recipient, filter, limit, notificationDisabled }, xLineRetryKey?)Arguments wrapped in a request object. Retry key moved to 2nd param.
broadcast(messages, notificationDisabled?)broadcast({ messages, notificationDisabled }, xLineRetryKey?)Arguments wrapped in a request object. Retry key moved to 2nd param.
setRequestOptionOnce({ retryKey })deletedPass xLineRetryKey as the 2nd argument to pushMessage / multicast / narrowcast / broadcast directly.

Message validation

Client methodLineBotClient methodNotes
validatePushMessageObjects(messages)validatePush({ messages })Renamed.
validateReplyMessageObjects(messages)validateReply({ messages })Renamed.
validateMulticastMessageObjects(messages)validateMulticast({ messages })Renamed.
validateNarrowcastMessageObjects(messages)validateNarrowcast({ messages })Renamed.
validateBroadcastMessageObjects(messages)validateBroadcast({ messages })Renamed.
validateCustomAggregationUnits(units)deletedClient-side validation only; no longer provided.

Profile & group

Client methodLineBotClient methodNotes
getProfile(userId)getProfile(userId)Same.
getGroupMemberProfile(groupId, userId)getGroupMemberProfile(groupId, userId)Same.
getRoomMemberProfile(roomId, userId)getRoomMemberProfile(roomId, userId)Same.
getGroupMemberIds(groupId)getGroupMembersIds(groupId, start?)Renamed (added s). No longer auto-paginates; returns a single page.
getRoomMemberIds(roomId)getRoomMembersIds(roomId, start?)Renamed (added s). No longer auto-paginates; returns a single page.
getBotFollowersIds()getFollowers(start?, limit?)Renamed. No longer auto-paginates; returns a single page (GetFollowersResponse). Loop with the next token to retrieve all followers.
getGroupMembersCount(groupId)getGroupMemberCount(groupId)Renamed (removed s).
getRoomMembersCount(roomId)getRoomMemberCount(roomId)Renamed (removed s).
getGroupSummary(groupId)getGroupSummary(groupId)Same.
getBotInfo()getBotInfo()Same.
leaveGroup(groupId)leaveGroup(groupId)Same.
leaveRoom(roomId)leaveRoom(roomId)Same.

Message content

Client methodLineBotClient methodNotes
getMessageContent(messageId)getMessageContent(messageId)Same. Returns Readable.

Rich menu

Client methodLineBotClient methodNotes
getRichMenu(richMenuId)getRichMenu(richMenuId)Same.
createRichMenu(richMenu)createRichMenu(richMenuRequest)Return type changed from string to RichMenuIdResponse.
deleteRichMenu(richMenuId)deleteRichMenu(richMenuId)Same.
getRichMenuAliasList()getRichMenuAliasList()Same.
getRichMenuAlias(richMenuAliasId)getRichMenuAlias(richMenuAliasId)Same.
createRichMenuAlias(richMenuId, richMenuAliasId)createRichMenuAlias({ richMenuId, richMenuAliasId })Arguments wrapped in a request object.
deleteRichMenuAlias(richMenuAliasId)deleteRichMenuAlias(richMenuAliasId)Same.
updateRichMenuAlias(richMenuAliasId, richMenuId)updateRichMenuAlias(richMenuAliasId, { richMenuId })2nd argument wrapped in a request object.
getRichMenuIdOfUser(userId)getRichMenuIdOfUser(userId)Return type changed from string to RichMenuIdResponse.
linkRichMenuToUser(userId, richMenuId)linkRichMenuIdToUser(userId, richMenuId)Renamed.
unlinkRichMenuFromUser(userId)unlinkRichMenuIdFromUser(userId)Renamed.
linkRichMenuToMultipleUsers(richMenuId, userIds[])linkRichMenuIdToUsers({ richMenuId, userIds })Renamed. Arguments wrapped in a request object.
unlinkRichMenusFromMultipleUsers(userIds[])unlinkRichMenuIdFromUsers({ userIds })Renamed. Arguments wrapped in a request object.
getRichMenuImage(richMenuId)getRichMenuImage(richMenuId)Same.
setRichMenuImage(richMenuId, data, contentType?)setRichMenuImage(richMenuId, body?)body is now Blob (optional) instead of Buffer | Readable. contentType removed.
getRichMenuList()getRichMenuList()Return type changed from RichMenuResponse[] to RichMenuListResponse.
setDefaultRichMenu(richMenuId)setDefaultRichMenu(richMenuId)Same.
getDefaultRichMenuId()getDefaultRichMenuId()Return type changed from string to RichMenuIdResponse.
deleteDefaultRichMenu()cancelDefaultRichMenu()Renamed.
validateRichMenu(richMenu)validateRichMenuObject(richMenu)Renamed.

Webhook

Client methodLineBotClient methodNotes
setWebhookEndpointUrl(endpoint)setWebhookEndpoint({ endpoint })Renamed. Argument wrapped in a request object.
getWebhookEndpointInfo()getWebhookEndpoint()Renamed.
testWebhookEndpoint(endpoint?)testWebhookEndpoint({ endpoint }?)Argument wrapped in a request object. The entire request object is optional.
Client methodLineBotClient methodNotes
getLinkToken(userId)issueLinkToken(userId)Renamed. Return type changed from string to IssueLinkTokenResponse.

Message delivery stats

Client methodLineBotClient methodNotes
getNumberOfSentReplyMessages(date)getNumberOfSentReplyMessages(date)Same.
getNumberOfSentPushMessages(date)getNumberOfSentPushMessages(date)Same.
getNumberOfSentMulticastMessages(date)getNumberOfSentMulticastMessages(date)Same.
getNumberOfSentBroadcastMessages(date)getNumberOfSentBroadcastMessages(date)Same.
getNarrowcastProgress(requestId)getNarrowcastProgress(requestId)Same.
getTargetLimitForAdditionalMessages()getMessageQuota()Renamed.
getNumberOfMessagesSentThisMonth()getMessageQuotaConsumption()Renamed.

Insight

Client methodLineBotClient methodNotes
getNumberOfMessageDeliveries(date)getNumberOfMessageDeliveries(date)Same.
getNumberOfFollowers(date)getNumberOfFollowers(date?)date is now optional.
getFriendDemographics()getFriendsDemographics()Renamed (added s).
getUserInteractionStatistics(requestId)getMessageEvent(requestId)Renamed.
getStatisticsPerUnit(unit, from, to)getStatisticsPerUnit(unit, from, to)Same.

Audience

Client methodLineBotClient methodNotes
createUploadAudienceGroup({ description, isIfaAudience?, audiences?, uploadDescription? })createAudienceGroup({ description, isIfaAudience, audiences, uploadDescription })Renamed.
createUploadAudienceGroupByFile({ description, isIfaAudience?, uploadDescription?, file })createAudienceForUploadingUserIds(file, description?, isIfaAudience?, uploadDescription?)Renamed. file type changed from Buffer | Readable to Blob.
updateUploadAudienceGroup({ audienceGroupId, description?, uploadDescription?, audiences })addAudienceToAudienceGroup({ audienceGroupId, uploadDescription, audiences }) then, if description was used, also call updateAudienceGroupDescription(audienceGroupId, { description })Renamed. description requires a separate call. The legacy per-request httpConfig argument has no direct replacement in LineBotClient.
updateUploadAudienceGroupByFile({ audienceGroupId, uploadDescription?, file })addUserIdsToAudience(file, audienceGroupId?, uploadDescription?)Renamed. file type changed from Buffer | Readable to Blob. The legacy per-request httpConfig argument has no direct replacement in LineBotClient.
createClickAudienceGroup({ description, requestId, clickUrl? })createClickBasedAudienceGroup({ description, requestId, clickUrl })Renamed.
createImpAudienceGroup({ requestId, description })createImpBasedAudienceGroup({ requestId, description })Renamed.
setDescriptionAudienceGroup(description, audienceGroupId)updateAudienceGroupDescription(audienceGroupId, { description })Renamed. Argument order reversed. audienceGroupId type changed from string to number.
deleteAudienceGroup(audienceGroupId)deleteAudienceGroup(audienceGroupId)audienceGroupId type changed from string to number.
getAudienceGroup(audienceGroupId)getAudienceData(audienceGroupId)Renamed. audienceGroupId type changed from string to number.
getAudienceGroups(page, description?, status?, size?, createRoute?, includesExternalPublicGroups?)getAudienceGroups(page, description?, status?, size?, includesExternalPublicGroups?, createRoute?)Last two arguments swapped.
getAudienceGroupAuthorityLevel()deletedNo equivalent in current API.
changeAudienceGroupAuthorityLevel(authorityLevel)deletedNo equivalent in current API.

Method mapping: OAuth → channelAccessToken.ChannelAccessTokenClient

OAuth methods are not on LineBotClient. They live on channelAccessToken.ChannelAccessTokenClient, which is constructed without a channel access token:

js
const { channelAccessToken } = require('@line/bot-sdk');
const oauthClient = new channelAccessToken.ChannelAccessTokenClient({});
OAuth methodChannelAccessTokenClient methodNotes
issueAccessToken(client_id, client_secret)issueChannelToken('client_credentials', client_id, client_secret)Renamed. grant_type is now an explicit argument.
revokeAccessToken(access_token)revokeChannelToken(access_token)Renamed.
verifyAccessToken(access_token)verifyChannelTokenByJWT(access_token)Renamed. Verifies a v2.1 (JWT-issued) channel access token.
verifyIdToken(id_token, client_id, nonce?, user_id?)deletedNo direct equivalent.
issueChannelAccessTokenV2_1(client_assertion)issueChannelTokenByJWT('client_credentials', 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', client_assertion)Renamed. grant_type and client_assertion_type are now explicit arguments.
getChannelAccessTokenKeyIdsV2_1(client_assertion)getsAllValidChannelAccessTokenKeyIds('urn:ietf:params:oauth:client-assertion-type:jwt-bearer', client_assertion)Renamed. client_assertion_type is now an explicit argument. Response shape changed: key_idskids.
revokeChannelAccessTokenV2_1(client_id, client_secret, access_token)revokeChannelTokenByJWT(client_id, client_secret, access_token)Renamed.

Type mapping

Most types in lib/types.ts are deprecated. Use the generated types from the sub-namespaces exported by @line/bot-sdk.

Note: A few helper types in lib/types.ts are still used by the current generated clients and are not deprecated: ApiResponseType<T>, MessageAPIResponseBase, LINE_REQUEST_ID_HTTP_HEADER_NAME, LINE_SIGNATURE_HTTP_HEADER_NAME, and MiddlewareConfig.

Config types

Old typeNew typeNotes
Config(no single replacement)Split: use LineBotClientChannelAccessTokenConfig for client (channelAccessToken) and MiddlewareConfig for middleware (channelSecret).
ClientConfigLineBotClientChannelAccessTokenConfigFrom @line/bot-sdk
MiddlewareConfigMiddlewareConfigUnchanged. No longer extends Config; only channelSecret is needed.

Webhook event types

Old typeNew typeNotes
WebhookRequestBodywebhook.CallbackRequestFrom @line/bot-sdk
WebhookEventwebhook.EventFrom @line/bot-sdk
EventBasewebhook.EventBaseFrom @line/bot-sdk
ReplyableEvent(no direct equivalent)In the new API, replyToken is included directly in each replyable event type (e.g. webhook.MessageEvent).
EventSourcewebhook.SourceFrom @line/bot-sdk
User (source)webhook.UserSourceFrom @line/bot-sdk
Group (source)webhook.GroupSourceFrom @line/bot-sdk
Room (source)webhook.RoomSourceFrom @line/bot-sdk
DeliveryContextwebhook.DeliveryContextFrom @line/bot-sdk
MessageEventwebhook.MessageEventFrom @line/bot-sdk
UnsendEventwebhook.UnsendEventFrom @line/bot-sdk
FollowEventwebhook.FollowEventFrom @line/bot-sdk
UnfollowEventwebhook.UnfollowEventFrom @line/bot-sdk
JoinEventwebhook.JoinEventFrom @line/bot-sdk
LeaveEventwebhook.LeaveEventFrom @line/bot-sdk
MemberJoinEventwebhook.MemberJoinedEventRenamed (added d).
MemberLeaveEventwebhook.MemberLeftEventRenamed.
PostbackEventwebhook.PostbackEventFrom @line/bot-sdk
VideoPlayCompleteEventwebhook.VideoPlayCompleteEventFrom @line/bot-sdk
BeaconEventwebhook.BeaconEventFrom @line/bot-sdk
AccountLinkEventwebhook.AccountLinkEventFrom @line/bot-sdk
DeliveryEventwebhook.PnpDeliveryCompletionEventRenamed.

Webhook message content types

Old typeNew typeNotes
EventMessagewebhook.MessageContentRenamed.
EventMessageBasewebhook.MessageContentBaseRenamed.
TextEventMessagewebhook.TextMessageContentRenamed.
ImageEventMessagewebhook.ImageMessageContentRenamed.
VideoEventMessagewebhook.VideoMessageContentRenamed.
AudioEventMessagewebhook.AudioMessageContentRenamed.
FileEventMessagewebhook.FileMessageContentRenamed.
LocationEventMessagewebhook.LocationMessageContentRenamed.
StickerEventMessagewebhook.StickerMessageContentRenamed.
ContentProviderwebhook.ContentProviderFrom @line/bot-sdk
Postbackwebhook.PostbackContentRenamed.

Outbound message types

Old typeNew typeNotes
MessageCommonmessagingApi.MessageBaseRenamed.
MessagemessagingApi.MessageFrom @line/bot-sdk
TextMessagemessagingApi.TextMessageFrom @line/bot-sdk
ImageMessagemessagingApi.ImageMessageFrom @line/bot-sdk
VideoMessagemessagingApi.VideoMessageFrom @line/bot-sdk
AudioMessagemessagingApi.AudioMessageFrom @line/bot-sdk
LocationMessagemessagingApi.LocationMessageFrom @line/bot-sdk
StickerMessagemessagingApi.StickerMessageFrom @line/bot-sdk
ImageMapMessagemessagingApi.ImagemapMessageRenamed (lowercase m).
TemplateMessagemessagingApi.TemplateMessageFrom @line/bot-sdk
FlexMessagemessagingApi.FlexMessageFrom @line/bot-sdk
ImageMapActionmessagingApi.ImagemapActionRenamed (lowercase m).
ImageMapActionBasemessagingApi.ImagemapActionBaseRenamed (lowercase m).
ImageMapURIActionmessagingApi.URIImagemapActionRenamed.
ImageMapMessageActionmessagingApi.MessageImagemapActionRenamed.
AreamessagingApi.ImagemapAreaRenamed.

Flex types

Old typeNew typeNotes
FlexContainermessagingApi.FlexContainerFrom @line/bot-sdk
FlexBubblemessagingApi.FlexBubbleFrom @line/bot-sdk
FlexBubbleStylemessagingApi.FlexBubbleStylesRenamed (added s).
FlexBlockStylemessagingApi.FlexBlockStyleFrom @line/bot-sdk
FlexCarouselmessagingApi.FlexCarouselFrom @line/bot-sdk
FlexComponentmessagingApi.FlexComponentFrom @line/bot-sdk
FlexBoxmessagingApi.FlexBoxFrom @line/bot-sdk
Offset(no direct equivalent)Fields (position, offsetTop, offsetBottom, offsetStart, offsetEnd) are now inlined into each Flex component type (e.g. messagingApi.FlexBox). messagingApi.FlexOffset is an unrelated string union for sizing keywords.
BackgroundmessagingApi.FlexBoxBackgroundRenamed.
FlexButtonmessagingApi.FlexButtonFrom @line/bot-sdk
FlexFillermessagingApi.FlexFillerFrom @line/bot-sdk
FlexIconmessagingApi.FlexIconFrom @line/bot-sdk
FlexImagemessagingApi.FlexImageFrom @line/bot-sdk
FlexVideomessagingApi.FlexVideoFrom @line/bot-sdk
FlexSeparatormessagingApi.FlexSeparatorFrom @line/bot-sdk
FlexTextmessagingApi.FlexTextFrom @line/bot-sdk
FlexSpacer(removed)Not part of messagingApi.FlexComponent in the new API. Use messagingApi.FlexFiller or box padding instead.
FlexSpanmessagingApi.FlexSpanFrom @line/bot-sdk

Template types

Old typeNew typeNotes
TemplateContentmessagingApi.TemplateRenamed.
TemplateButtonsmessagingApi.ButtonsTemplateRenamed.
TemplateConfirmmessagingApi.ConfirmTemplateRenamed.
TemplateCarouselmessagingApi.CarouselTemplateRenamed.
TemplateColumnmessagingApi.CarouselColumnRenamed.
TemplateImageCarouselmessagingApi.ImageCarouselTemplateRenamed.
TemplateImageColumnmessagingApi.ImageCarouselColumnRenamed.

Action / quick reply types

Old typeNew typeNotes
QuickReplymessagingApi.QuickReplyFrom @line/bot-sdk
QuickReplyItemmessagingApi.QuickReplyItemFrom @line/bot-sdk
SendermessagingApi.SenderFrom @line/bot-sdk
ActionmessagingApi.ActionFrom @line/bot-sdk
PostbackActionmessagingApi.PostbackActionFrom @line/bot-sdk
MessageActionmessagingApi.MessageActionFrom @line/bot-sdk
URIActionmessagingApi.URIActionFrom @line/bot-sdk
AltURImessagingApi.AltUriRenamed (lowercase ri).
DatetimePickerActionmessagingApi.DatetimePickerActionFrom @line/bot-sdk
RichMenuSwitchActionmessagingApi.RichMenuSwitchActionFrom @line/bot-sdk

Rich menu types

Old typeNew typeNotes
SizemessagingApi.RichMenuSizeRenamed.
RichMenumessagingApi.RichMenuRequestRenamed.
RichMenuResponsemessagingApi.RichMenuResponseFrom @line/bot-sdk
GetRichMenuAliasResponsemessagingApi.RichMenuAliasResponseRenamed.
GetRichMenuAliasListResponsemessagingApi.RichMenuAliasListResponseRenamed.

Response / stats types

Old typeNew typeNotes
ProfilemessagingApi.UserProfileResponseRenamed.
BotInfoResponsemessagingApi.BotInfoResponseFrom @line/bot-sdk
GroupSummaryResponsemessagingApi.GroupSummaryResponseFrom @line/bot-sdk
MembersCountResponsemessagingApi.GroupMemberCountResponse or messagingApi.RoomMemberCountResponseSplit into two types.
WebhookEndpointInfoResponsemessagingApi.GetWebhookEndpointResponseRenamed.
TestWebhookEndpointResponsemessagingApi.TestWebhookEndpointResponseFrom @line/bot-sdk
TargetLimitForAdditionalMessagesmessagingApi.MessageQuotaResponseRenamed.
NumberOfMessagesSentThisMonthmessagingApi.QuotaConsumptionResponseRenamed.
NumberOfMessagesSentResponsemessagingApi.NumberOfMessagesResponseRenamed.
NarrowcastProgressResponsemessagingApi.NarrowcastProgressResponseFrom @line/bot-sdk

Insight types

Old typeNew typeNotes
NumberOfMessageDeliveriesinsight.GetNumberOfMessageDeliveriesResponseRenamed.
NumberOfFollowersinsight.GetNumberOfFollowersResponseRenamed.
NumberOfMessageDeliveriesResponseinsight.GetNumberOfMessageDeliveriesResponseRenamed.
NumberOfFollowersResponseinsight.GetNumberOfFollowersResponseRenamed.
FriendDemographicsinsight.GetFriendsDemographicsResponseRenamed.
UserInteractionStatisticsinsight.GetMessageEventResponseRenamed.
InsightStatisticsResponse(no direct equivalent)Shared base type. In the new API, the status field is inlined into each concrete response type.
StatisticsPerUnitinsight.GetStatisticsPerUnitResponseRenamed.

Narrowcast types

Old typeNew typeNotes
ReceieptObjectmessagingApi.RecipientRenamed (also fixes typo). Union structure differs: old type used FilterOperatorObject wrappers; new type includes OperatorRecipient as a direct variant.
DemographicFilterObjectmessagingApi.DemographicFilterUnion structure differs: old type used FilterOperatorObject wrappers; new type includes OperatorDemographicFilter as a direct variant.

Audience types

Old typeNew typeNotes
AudienceGroupStatusmanageAudience.AudienceGroupStatusFrom @line/bot-sdk
AudienceGroupCreateRoutemanageAudience.AudienceGroupCreateRouteFrom @line/bot-sdk
AudienceGroupmanageAudience.AudienceGroupFrom @line/bot-sdk
AudienceGroupsmanageAudience.AudienceGroup[]No longer a named type.
AudienceGroupAuthorityLeveldeletedNo equivalent in current API.

Channel access token types

Old typeNew typeNotes
ChannelAccessTokenNo single equivalent. See below.Shape depends on which method was called.
VerifyAccessTokenchannelAccessToken.VerifyChannelAccessTokenResponseRenamed.
VerifyIDTokendeletedNo direct equivalent.

ChannelAccessToken has no single replacement.

  • If the type was returned by issueAccessToken, use channelAccessToken.IssueShortLivedChannelAccessTokenResponse. Note: this type has no key_id field.
  • If the type was returned by issueChannelAccessTokenV2_1, use channelAccessToken.IssueChannelAccessTokenResponse. Note: key_id is a required field in this type (not optional as in the legacy type).

IssueStatelessChannelAccessTokenResponse is a different token type entirely (15-minute lifetime, non-revocable) and is not a replacement for either legacy path.

Error types

Old classNew classNotes
HTTPErrorHTTPFetchErrorDifferent properties; see error handling.
RequestError(no equivalent)Axios network/connection error. LineBotClient does not wrap these; native fetch() throws a TypeError instead.
ReadError(no equivalent)Axios read error. LineBotClient does not wrap these; native fetch() errors propagate unwrapped.
SignatureValidationFailedSignatureValidationFailedUnchanged.
JSONParseErrorJSONParseErrorUnchanged.