Wrong Document about JavaScript SDK

MESSAGE_TYPE_FILTER type is string in the document.
But, it is actually

load(limit: number, reverse: boolean, messageType?: number, callback?: messageListCallback): Array<UserMessage | FileMessage | AdminMessage>;

And the TypeScript type definition should be 0 | 1 | 2 | 3 (0: ALL, 1: USER, 2: FILE, 3: ADMIN) rather than number.

Hi @ryota_yamamoto,

Welcome to the Sendbird community! It looks like this information is incorrect in a couple of places. I’ll work to get this corrected.

Thank you so much for pointing this out.

1 Like

Hi @ryota_yamamoto,

I wanted to circle back to this. It turns out we do actually expect to use a number, however there is a bug in type conversion. We’re fixing that soon. So the API Reference and Type files are correct, just not working as expected.

Hi @Tyler ,
Thank you for addressing this issue.

I don’t understand what you’re saying:

the API Reference and Type files are correct

In the document MESSAGE_TYPE_FILTER is string, but SDK type definition is messageType?: number. (And the SDK works well with number.)

Hi @ryota_yamamoto,

Sorry for the confusion. The SDK should accept both a string or a number, however currently if you pass in a number it rejects it. The type conversion in place is somehow bypassed. Our Engineering team is correcting this.

1 Like

This has been corrected in the latest version of the JS SDK.

Documentation will be updated soon.

Looks very good!
Thank you!