Creating an Open Channel not letting me set the channel URL

I am attempting to use the Javascript SDK in my React app to create an open channel.

const params: SendBird.OpenChannelParams = new sdk.OpenChannelParams();
params.name = channelId;
params.data = JSON.stringify({
  shipmentId: channelId,
});
params.channelUrl = channelId;
sdk.OpenChannel.createChannel(params, (openChannel) => {
  ...
});

I’m using params.channelUrl to set a unique URL, as per the docs, but in the POST the channelUrl is never used. The POST body to /v3/open_channels only uses the name, data, and operators keys.

Is there something I’m doing wrong here?

UPDATE:

I don’t see channelUrl being used in the minified Sendbird.min.js code for creating an OpenChannel:

{
            key: "createChannel",
            value: function() {
                var i = this
                  , n = W.toArray(arguments)
                  , e = null;
                "function" == typeof n[n.length - 1] && (e = n.pop());
                var t = B.get(this._iid)
                  , r = t.OpenChannel
                  , t = t.OpenChannelParams;
                if (n[0]instanceof t && 1 === n.length)
                    return ae(this._iid, function(r) {
                        var e = n[0];
                        e._validate() ? ce.get(i._iid).container.apiClient.createOpenChannel(e, function(e, n) {
                            var t = null;
                            e || (t = B.get(i._iid).OpenChannel.upsert(n)),
                            r(e, t)
                        }) : r(W.error, null)
                    }, e);
                var a = new t;
                switch (n.length) {
                case 0:
                    break;
                case 1:
                    a.name = n[0];
                    break;
                case 2:
                    a.name = n[0],
                    a.coverUrlOrImage = n[1];
                    break;
                case 3:
                    a.name = n[0],
                    a.coverUrlOrImage = n[1],
                    a.data = n[2];
                    break;
                case 4:
                    a.name = n[0],
                    a.coverUrlOrImage = n[1],
                    a.data = n[2],
                    a.operatorUserIds = n[3];
                    break;
                case 5:
                    a.name = n[0],
                    a.coverUrlOrImage = n[1],
                    a.data = n[2],
                    a.operatorUserIds = n[3],
                    a.customType = n[4];
                    break;
                default:
                    return ae(this._iid, function(e) {
                        return e(W.error, null)
                    }, e)
                }
                return e ? r.createChannel(a, e) : r.createChannel(a)
            }

If you look at the switch/case statement, channelUrl is missing.

1 Like

Hi @mwq27,

Looks like you are correct, that it appears to be missing. Let me work with our Engineering team to validate.

1 Like

Thanks Tyler,

Do you know if this bug has been confirmed, and if a patch is coming soon?

Hi @mwq27,

I’ve heard anything back on this yet. As soon as I hear something, I’ll make sure to pass it your way.

-Tyler

Hello is there an update for this? I am using GitHub - sendbird/SendBird-SDK-JavaScript: Sendbird Chat SDK for JavaScript for enablement of a rich, engaging, scalable, and real-time chat service. and running into the same issue. Would like to know if there is a work around or if fix is coming soon.

Hello @sharewell,

This has not yet been corrected. As soon as it has been fixed, I’ll make sure to update here.

Hi @Tyler

I have exact same issue. Is there any plan to fix this one?

Hi @Dogyun_Jeong,

Welcome to the Sendbird Community. What version of the SDK are you using?

Hi @Tyler

I am here again.

I am using the client javascript SDK version 3.1.30, the latest version on NPM. and still have same error.

Below is my Code. I tried to setup name or other params. Then the params working correctly.

The “channelId” is a uuidv4

    const params = new sb.OpenChannelParams();
    params.channelUrl = channelId;
    sb.OpenChannel.createChannel(params, (channel, error) => {

I also use platform API to create a channel at serverside. The platfor API function work as expected with specified channle ID

Hi I have a problem with creating new open channel with Javascript Client SDK

This issue has been reported already in Creating an Open Channel not letting me set the channel URL

Is there any update for this?