itim
itutorgroup im sdk
Last updated 2 months ago by klintcheng .
MIT · Original npm · Tarball · package.json
$ cnpm install itim 
SYNC missed versions from official npm registry.

1. js sdk

1.1. 简介

1.2. Quick start

import { ITIM, ITIMEvent, LogLevel ,ITIMSession} from "itim"

const appKey = "your_appKey"
const token = "your_jwt_token"

let client = ITIM.Build(appKey, recvToken, new ITIMConfig({ Log: LogLevel.WARN }))

client.onEvent((evt: ITIMEvent) => {
    console.log(evt)
})

client.onMessage(async (session: ITIMSession, msg: ChatMessage) => {
    console.log(msg)
})

// login
let { code, ack }  = await client.login()
console.log(ack)

let session = client.getSession(ITIMChatType.Chat, recv)
let { code, message } = await session.send(ITIM.BuildTextMessage("got it", {
    "time": Date.now()
}))
expect(code).toBe(ITIMErrCode.Ok)

console.log(message.getMsgId())
console.log(message.getFrom())
console.log(message.getSendTime())

await client.logout()

Current Tags

  • 0.0.25                                ...           latest (2 months ago)

26 Versions

  • 0.0.25                                ...           2 months ago
  • 0.0.24                                ...           2 months ago
  • 0.0.23                                ...           2 months ago
  • 0.0.22                                ...           4 months ago
  • 0.0.21                                ...           4 months ago
  • 0.0.20                                ...           4 months ago
  • 0.0.18                                ...           4 months ago
  • 0.0.17                                ...           4 months ago
  • 0.0.16                                ...           5 months ago
  • 0.0.15                                ...           5 months ago
  • 0.0.14                                ...           5 months ago
  • 0.0.13                                ...           5 months ago
  • 0.0.12                                ...           5 months ago
  • 0.0.11                                ...           5 months ago
  • 0.0.10                                ...           5 months ago
  • 0.0.9                                ...           5 months ago
  • 0.0.8                                ...           5 months ago
  • 0.0.8-0                                ...           5 months ago
  • 0.0.7-1                                ...           5 months ago
  • 0.0.7-0                                ...           5 months ago
  • 0.0.6-0                                ...           5 months ago
  • 0.0.5                                ...           5 months ago
  • 0.0.4                                ...           5 months ago
  • 0.0.3                                ...           5 months ago
  • 0.0.2                                ...           5 months ago
  • 0.0.1                                ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |