#Realtime Docs are outdated

37 messages · Page 1 of 1 (latest)

lofty kraken
#

The Realtime docs are outdated.

#

at least for the web/javascript version

lean delta
#

Also, at the bottom of the page there should be a button or form to submit feedback on the docs.

lofty kraken
#

Look at the example code for the Web sdk

#

client.subscribe is now deprecated

#

But still shown in the example

lean delta
#

I see

lofty kraken
lean delta
#

What's the correct way? (I haven't used realtime myself in any project yet)

lofty kraken
#

That’s what I’m asking

#

I just tried to fiddle around with the new Realtime class

lean delta
lofty kraken
#

But I’m not sure exactly how to correctly use it

lofty kraken
lean delta
#

Let me.... uh... cc @grizzled lotus

lofty kraken
#

I cant even seem to consistently connect to the realtime endpoint using the new sdk

#

very weird

lean delta
lofty kraken
#

nope im self-hosted

lean delta
#

Ah yeah, missed the tag

#

I guess we'll have to wait for a response from the team

#

If tomorrow this still isn't answered, I will notify the team again just in case

lofty kraken
#

just for context:

const channel = `databases.${process.env.NEXT_PUBLIC_APPWRITE_DATABASE_ID}.tables.${process.env.NEXT_PUBLIC_APPWRITE_COLLECTION_LIGHTS_ID}.rows`;

        const realtime = new Realtime(client);

        let close: () => Promise<void>;
        realtime.subscribe(channel, async (response) => {
            console.log(response);
            const newLights = await getLightsAction();

            setLights(newLights)
        }).then(sub => close = sub.close);

        return () => close();
#

Idk if this is how your supposed to use the new sdk 🤷‍♂️

grizzled lotus
lofty kraken
#

So did I do it the right way or do I really need to wait until someone eventually updates the docs?

lofty kraken
sonic dust
#

@grizzled lotus Any updates? Thank you appwriteheart

halcyon sandal
#

We're working on a number of updates on the Realtime docs, will message as soon as the update is made

lofty kraken
#

Yeah we get that but do you really expect us to wait for an enventual update on the docs instead of just telling us how to use it right here? Im fairly sure that Im not the only one wondering on how to properly use the sdk.

river girder
#

Also waiting for updates. Been trying to get realtime working for several days before coming here and realizing the docs are outdated.

halcyon sandal
#

The client.subscribe deprecation and shift to the Realtime class is now reflected in the Realtime docs examples

#

Huge apologies for the delays on this front

regal heron
# halcyon sandal The client.subscribe deprecation and shift to the Realtime class is now reflecte...

Is the self-hosted version of appwrite capable of handling the new Realtime? It seems to be a bit off, since nothing happens after the trigger. I saw there’s an open issue on GitHub on similar topic (but with the old realtime) https://github.com/appwrite/appwrite/issues/10923
and I also encounter the issue with both old and new realtime on my self host. Seems to work fine on cloud.

GitHub

👟 Reproduction steps Create a table with a document containing a numeric field (e.g. credits). Subscribe to that document’s realtime channel from the web SDK, e.g.: const client = new Client() .set...