# New API: Wix Realtime

**URL:** <https://forum.wixstudio.com/t/new-api-wix-realtime/24709>\
**Category:** Be in the know\
**Tags:** news, code\
**Created:** [February 24, 2020, 2:14pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709 "2020-02-24T14:14:05Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![shay-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/shay-wix/32/669_2.png) [@shay-wix](https://forum.wixstudio.com/u/shay-wix)\
**Post date:** [February 24, 2020, 2:14pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/1 "2020-02-24T14:14:05Z")

</div>

**We’re happy to announce the release of the new Realtime Module for Corvid.**

**Using the Realtime API you can create channels and channel resources where messages can be published. Site visitors who subscribe to a channel receive the messages published to that channel.**

**Typical uses of the Realtime API include implementing a messaging system or as an alternative to using a polling mechanism.**

**Read more at** [**https://www.wix.com/corvid/reference/wix-realtime.html**](https://www.wix.com/corvid/reference/wix-realtime.html)

[https://static.wixstatic.com/media/a27d24\_60083bcbaccb4b3db6cf2d69d88bab00~mv2.gif(image larger than 4 MB)](https://static.wixstatic.com/media/a27d24_60083bcbaccb4b3db6cf2d69d88bab00~mv2.gif)

---

<div class="post-metadata">

**Author:** ![webmasterq](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/webmasterq/32/11799_2.png) [@webmasterq](https://forum.wixstudio.com/u/webmasterq)\
**Post date:** [February 24, 2020, 6:38pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/2 "2020-02-24T18:38:15Z")

</div>

How do users get notified? Is there a way to show a channel in a repeater?

---

<div class="post-metadata">

**Author:** ![webmasterq](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/webmasterq/32/11799_2.png) [@webmasterq](https://forum.wixstudio.com/u/webmasterq)\
**Post date:** [February 25, 2020, 2:51pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/3 "2020-02-25T14:51:59Z")

</div>

I just don’t understand how this works to be honest

---

<div class="post-metadata">

**Author:** ![shahar-talmi-1](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/shahar-talmi-1/32/3524_2.png) [@shahar-talmi-1](https://forum.wixstudio.com/u/shahar-talmi-1)\
**Post date:** [February 26, 2020, 7:43am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/4 "2020-02-26T07:43:33Z")

</div>

You subscribe to notifications in your code using wixRealtime.subscribe() and then you can put it wherever you like (including repeaters). Channels are not opinionated regarding how you decide to display the notification, it is totally up to your code implementation.

---

<div class="post-metadata">

**Author:** ![webmasterq](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/webmasterq/32/11799_2.png) [@webmasterq](https://forum.wixstudio.com/u/webmasterq)\
**Post date:** [February 26, 2020, 8:45am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/5 "2020-02-26T08:45:32Z")

</div>

Do subscribers get notifications of some kind?

---

<div class="post-metadata">

**Author:** ![christopher-derrell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/christopher-derrell/32/1460_2.png) [@christopher-derrell](https://forum.wixstudio.com/u/christopher-derrell)\
**Post date:** [March 9, 2020, 11:20pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/6 "2020-03-09T23:20:53Z")

</div>

This is big. I just don’t think we realize how big yet.

---

<div class="post-metadata">

**Author:** ![simonadams](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@simonadams](https://forum.wixstudio.com/u/simonadams)\
**Post date:** [March 13, 2020, 11:47am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/7 "2020-03-13T11:47:05Z")

</div>

This is massive, it will be even bigger once we can also do a face to face web meeting. are their any examples other than those in the API reference that show how to best utilise the wix-realtime API for a messaging system?

---

<div class="post-metadata">

**Author:** ![sam-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sam-wix/32/683_2.png) [@sam-wix](https://forum.wixstudio.com/u/sam-wix)\
**Post date:** [March 15, 2020, 5:44am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/8 "2020-03-15T05:44:06Z")

</div>

We have two full use-case examples that are in the works.

---

<div class="post-metadata">

**Author:** ![lotsoflandinc](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/lotsoflandinc/32/17668_2.png) [@lotsoflandinc](https://forum.wixstudio.com/u/lotsoflandinc)\
**Post date:** [March 15, 2020, 8:18am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/9 "2020-03-15T08:18:29Z")

</div>

I have no clue what all of this says but I looked at what you are doing with the real estate subscription page and data import ai need something like that done.

---

<div class="post-metadata">

**Author:** ![simonadams](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@simonadams](https://forum.wixstudio.com/u/simonadams)\
**Post date:** [March 15, 2020, 9:05am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/10 "2020-03-15T09:05:20Z")

</div>

Amazing, any idea when they’ll be available? also will this allow face to face meetings via camera?

---

<div class="post-metadata">

**Author:** ![adcatch02](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/adcatch02/32/12916_2.png) [@adcatch02](https://forum.wixstudio.com/u/adcatch02)\
**Post date:** [March 15, 2020, 6:50pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/11 "2020-03-15T18:50:50Z")

</div>

Can’t wait to see these full case uses, as I also think this will be a seriously cool addition  
well done Wix

---

<div class="post-metadata">

**Author:** ![chris-derrell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/chris-derrell/32/1774_2.png) [@chris-derrell](https://forum.wixstudio.com/u/chris-derrell)\
**Post date:** [April 1, 2020, 2:07pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/12 "2020-04-01T14:07:45Z")

</div>

@sam-wix Following up with this Sam

---

<div class="post-metadata">

**Author:** ![sam-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sam-wix/32/683_2.png) [@sam-wix](https://forum.wixstudio.com/u/sam-wix)\
**Post date:** [April 1, 2020, 6:19pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/13 "2020-04-01T18:19:28Z")

</div>

So the first one is the real estate example from above that has recently been added to the examples site: [https://www.wix.com/corvid/example/real-time-notifications-for-new-real-estate](https://www.wix.com/corvid/example/real-time-notifications-for-new-real-estate) .

And the second one, we’re going to take a different direction because it is a bit complex. It will probably not be on the Corvid site with the other examples. Instead, we will be writing a tutorial based on the example and you will be able to get that example from the tutorial. This make take a bit of time. Could be that I can get you a link to the example before the tutorial is written if that will help.

---

<div class="post-metadata">

**Author:** ![simonadams](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@simonadams](https://forum.wixstudio.com/u/simonadams)\
**Post date:** [April 2, 2020, 10:50am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/14 "2020-04-02T10:50:09Z")

</div>

that would be amazing, if I can help at all I am happy to do so also.

---

<div class="post-metadata">

**Author:** ![sam-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sam-wix/32/683_2.png) [@sam-wix](https://forum.wixstudio.com/u/sam-wix)\
**Post date:** [April 2, 2020, 3:14pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/15 "2020-04-02T15:14:31Z")

</div>

Alright, here it is. As I said we’re not completely done with this so it is subject to change.

A little explanation: It is a news site where we’ve implemented a breaking news feature using the Realtime API. Members of the news site can subscribe to categories of breaking news they’d like to be alerted to. The categories and member subscriptions are stored in two database collections. There are three areas with code. First is the home page, which is where alerts are received. Second is a lightbox opened from the settings icon on the home page, where members can manage their subscriptions. Third is an admin page, where the admin sends messages to subscribers of various categories. To see all this in action, you’ll need to have the site open twice - one acting as a member and one acting as the admin. There’s a bit I left out here, but I leave that up to you to discover.

Here is the [template](https://editor.wix.com/html/editor/web/renderer/new?siteId=f017db9d-4b4f-413b-aaaa-f71a0340e7d5&metaSiteId=bea8a2e9-ea98-4e4c-a3ad-d2a53638a0ce&autoDevMode=true) so you can try it out yourself. Let me know how it goes.

---

<div class="post-metadata">

**Author:** ![simonadams](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@simonadams](https://forum.wixstudio.com/u/simonadams)\
**Post date:** [April 2, 2020, 3:23pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/16 "2020-04-02T15:23:21Z")

</div>

@sam-wix Thank you for this, I now see where or how to utilise publish, I did not think about placing it within a JSW and this will make what I am trying to achieve a lot easier, I can understand what it is your achieving with the template and it is very cool, I am trying to build a messaging system so individuals can share, data by way of messages and also files encrypted at both ends. It will take me sometime to complete the messaging feature but will be amazing if all works. It would be great to also get webcam access so that this can be delivered via the realtime API also. Many have suggested the wix chatbox feature but it has limitations to what I need, what you are demonstrating in this will help many massively.

---

<div class="post-metadata">

**Author:** ![sam-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sam-wix/32/683_2.png) [@sam-wix](https://forum.wixstudio.com/u/sam-wix)\
**Post date:** [April 3, 2020, 8:07am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/17 "2020-04-03T08:07:24Z")

</div>

@simonadams Yes, right now all message publishing must be routed through the backend. There are plans for a client-side publish function as well.

---

<div class="post-metadata">

**Author:** ![simonadams](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@simonadams](https://forum.wixstudio.com/u/simonadams)\
**Post date:** [April 3, 2020, 8:49am UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/18 "2020-04-03T08:49:00Z")

</div>

It’s ok to have it go through the backend I thought it would but just wasn’t sure how to achieve it. do you believe one day that it would be achievable to have webcam access and do face to face messaging via the real-time api?

---

<div class="post-metadata">

**Author:** ![stcroppe](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/stcroppe/32/4559_2.png) [@stcroppe](https://forum.wixstudio.com/u/stcroppe)\
**Post date:** [May 17, 2020, 4:52pm UTC](https://forum.wixstudio.com/t/new-api-wix-realtime/24709/19 "2020-05-17T16:52:33Z")

</div>

@sam-wix Hi Sam hope you are well. I have tried to test this capability out BUT the subscribe never seems to complete. If I use await the call hangs forever and doesn’t even seem to time out. If I use promise then() the then is never called.

This means that when I place a backend call into publish() it always returns a 400 error. Presumably because I am not subscribed and so the publish doesn’t know who it is targetting?

It seems to me that something is missing in the configuration of the realtime capability. Shouldn’t there be a back end configuration that is used to set up and define which channels are configured to allow subscription to? Could that be why the subscribe never completes? Or is the subscribe() never completing simply down to a backend Wix bug?
