getTotalUnreadCount
getTotalUnreadCount on Amity.Client
StreamRepository.queryStreams() | Use StreamRepository.getStreams() instead |
StreamRepository.getStream() | Use StreamRepository.getStreamById() instead |
CommunityRepository.getTopTrendingCommunities() | Use CommunityRepository.getTrendingCommunity() instead |
This guide is to provide information about breaking changes and how to migrate to the Amity TS SDK 6.0.0 version.
npm i @amityco/ts-sdk@^6.0.0
yarn add @amityco/ts-sdk@^6.0.0
Starting from 6.0.0
we recommend to use API's async
hronously. As it will soon be deprecated. Example:
The real time events are supported via MQTT, which has a crucial difference in how it works compared to web sockets. This is, events are not broadcast-ed to all users. So this means that you only get real time event updates to those topics that you subscribe to.
Note: Some exceptions to this are message events and smart feed events. If you are unsure if subscription is required for a particular topic, check the code-snippet for that particular API for details.
There are also other limitations to getting RTE's, example: you cannot subscribe to events for a community that you are not a member of. Check documentation for full details.
You can read more about MQTT here: https://mqtt.org/
Although live objects were introduced prior to v6. All getter methods for singular objects (example getPost
) will now return a subscribe-able object.
This means that if an object gets updated and you have subscribed to real time events, the object will get updated automatically via real time events.
If for your use case you don't require any real time updates, you can unsubscribe immediately. For further information about Live Object, please visit #live-object page.
Although live collections were introduced prior to v6. All query methods for collection of objects (example getPosts
) will now return a subscribe-able collection.
This means that if an object in the collection gets updated and you have subscribed to real time events, the collection will get updated automatically via real time events.
If for your use case you don't require any real time updates, you can unsubscribe immediately. Similar to live objects above. For further information about Live Object, please visit #live-collection page.
Starting from 6.0.0
, you will no longer be able to import individual SDK API's. You'll need to import the required API from it's respective Repositories.
Client
import { Client } from '@amityco/ts-sdk
import { UserRepository } from '@amityco/ts-sdk
import { FileRepository } from '@amityco/ts-sdk
import { ReactionRepository } from '@amityco/ts-sdk
import { CommunityRepository } from '@amityco/ts-sdk
import { StreamRepository } from '@amityco/ts-sdk
import { PostRepository } from '@amityco/ts-sdk
import { CommentRepository } from '@amityco/ts-sdk
import { PollRepository } from '@amityco/ts-sdk
import { ChannelRepository } from '@amityco/ts-sdk
import { MessageRepository } from '@amityco/ts-sdk
Method | Changed To |
---|---|
Method | Changed To | Type |
---|---|---|
Method | Changed To |
---|---|
Method | Changed To | Type |
---|---|---|
Method | Changed To | Type |
---|---|---|
Method | Changed To |
---|---|
Method | Changed To | Type |
---|---|---|
Method | Changed To | Type |
---|---|---|
Method | Changed To |
---|---|
Method | ChangedTo | Type |
---|---|---|
Method | Changed To | Type |
---|---|---|
createClient
Client.createClient
connectClient
Client.login
disconnectClient
Client.logout
subscribeTopic
Client.SubscribeTopic
liveUser
UserRepository.getUser
Live Object
liveUsers
UserRepository.getUsers
Live Collection
updateUser
UserRepository.updateUser
createReport
UserRepository.flagUser
deleteReport
UserRepository.unFlagUser
liveFollowers
UserRepository.Relationship.getFollowers
Live Collection
liveFollowings
UserRepository.Relationship.getFollowings
Live Collection
liveFollowInfo
UserRepository.Relationship.getFollowInfo
Live Object
acceptFollower
UserRepository.Relationship.acceptFollower
declineFollower
UserRepository.Relationship.declineFollower
follow
UserRepository.Relationship.follow
unfollow
UserRepository.Relationship.unfollow
getFile
FileRepository.getFile
deleteFile
FileRepository.deleteFile
queryReactions
ReactionRepository.getReactions
Live Collection
addReaction
ReactionRepository.addReaction
removeReaction
ReactionRepository.removeReaction
createCommunity
CommunityRepository.createCommunity
joinCommunity
CommunityRepository.joinCommunity
leaveCommunity
CommunityRepository.leaveCommunity
liveCommunity
CommunityRepository.getCommunity
Live Object
liveCommunities
CommunityRepository.getCommunities
Live Collection
updateCommunity
CommunityRepository.updateCommunity
liveCommunityMembers
CommunityRepository.Membership.getMembers
Live Collection
addCommunityMembers
CommunityRepository.Membership.addMembers
removeCommunityMembers
CommunityRepository.Membership.removeMembers
addCommunityMemberRoles
CommunityRepository.Membership.addRoles
removeCommunityMemberRoles
CommunityRepository.Membership.removeRoles
liveCategories
CommunityRepository.getCategories
Live Collection
deleteCommunity
CommunityRepository.deleteCommunity
getRecommendedCommunities
CommunityRepository.getRecommendedCommunities
getTopTrendingCommunities
CommunityRepository.getTopTrendingCommunities
getStream
StreamRepository.getStream
queryStreams
StreamRepository.getStreams
createStream
StreamRepository.createStream
createPost
PostRepository.createPost
updatePost
PostRepository.updatePost
deletePost
PostRepository.deletePost
livePost
PostRepository.getPost
Live Object
livePosts
PostRepository.getPosts
Live Collection
approvePost
PostRepository.approvePost
declinePost
PostRepository.declinePost
createComment
CommentRepository.createComment
updateComment
CommentRepository.updateComment
deleteComment
CommentRepository.deleteComment
liveComment
CommentRepository.getComment
Live Object
liveComments
CommentRepository.getComments
Live Collection
createPoll
PollRepository.createPoll
closePoll
PollRepository.closePoll
getPoll
PollRepository.getPoll
votePoll
PollRepository.votePoll
deletePoll
PollRepository.deletePoll
createChannel
ChannelRepository.createChannel
liveChannel
ChannelRepository.getChannel
Live Object
liveChannels
ChannelRepository.getChannels
Live Collection
joinChannel
ChannelRepository.joinChannel
leaveChannel
ChannelRepository.leaveChannel
addChannelMembers
ChannelRepository.Membership.addMembers
removeChannelMembers
ChannelRepository.Membership.removeMembers
getChannelMembers
ChannelRepository.Membership.getMembers
Live Collection
createMessage
MessageRepository.createMessage
updateMessage
MessageRepository.updateMessage
deleteMessage
MessageRepository.deleteMessage
liveMessage
MessageRepository.getMessage
Live Object
liveMessages
MessageRepository.getMessages
Live Collection