git clone https://github.com/relationlabs/relation-im-demo.git
cd relation-im-demo
npm install
npm run dev
import { authByMetamask } from '@relationlabs/auth';
const { authResult } = await authByMetamask();
const { token, error } = await RelationIM.getRelationToken(
authResult.token,
APIKEY
)
const userInfoRes = await im.getUserInfo()
const res = await im.getFollowing({
address: relationId,
limit,
cursor
})
const res = await im.follow(relationId)
const res = await im.unfollow(relationId)
const im = RelationIM.init({ token, apiKey: APIKEY, connect: true })
const res = await im.userChannelsList({
cursor,
limit
})
im.bind(Im.RECEIVE_MSG_OK,(event) => {...})
const res = await im.messageList({
channelUuid,
maxCreateAt: new Date().getTime(),
limit
})
const res = await im.sendMessage({
channelUuid,
content
})