Tutorial: Relationship Chain Usage Guide (Web & Mini Program)

Relationship Chain Usage Guide (Web & Mini Program)

Relationship Chain

The SDK supports relationship chains from v2.13.0. Since the relationship chain feature is not needed by most customers' business scenarios, and the feature increases the volume of SDK by 30 KB, for better backward compatibility, we have separated the SDK supporting relationship chains, and customers can integrate it according to their own business scenarios.

1. Upgrade your SDK to v2.13.0 or later.

Please use npm to upgrade the SDK.

Web:

npm install tim-js-sdk --save

Mini Program:

npm install tim-wx-sdk --save

APIs are completely backward compatible, and the use methods of all APIs remain unchanged. For details, see the API documentation.

2. Integrate the SDK as needed.

If your project needs the relationship chain feature, please use tim-js-friendship.js.

import TIM from 'tim-js-sdk/tim-js-friendship.js';

If your project does not need the relationship chain feature, please use tim-js.js.

// tim-js.js is used by default
import TIM from 'tim-js-sdk';

If you have integrated tim-js.js and call relationship chain APIs, the SDK will return the error code 2998, indicating the failure to find the module.

3. For technical exchanges, join the Tencent Cloud IM technology QQ group 468195767.