# SendbirdProvider and getDisconnect

**URL:** <https://community.sendbird.com/t/sendbirdprovider-and-getdisconnect/10276>\
**Category:** React\
**Tags:** javascript\
**Created:** [November 6, 2024, 2:50am UTC](https://community.sendbird.com/t/sendbirdprovider-and-getdisconnect/10276 "2024-11-06T02:50:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_Martin](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/aaron_martin/32/5563_2.png) [@Aaron\_Martin](https://community.sendbird.com/u/Aaron_Martin)\
**Post date:** [November 6, 2024, 2:50am UTC](https://community.sendbird.com/t/sendbirdprovider-and-getdisconnect/10276/1 "2024-11-06T02:50:16Z")

</div>

I am building a React/Nextjs app that uses the SendbirdProvider component to initialize the Chat UI. Using `uikit-react@3.15.3`. I have configured Sendbird webhook events to fire to my backend api for `group_channel:message_send` events so that I can detect when logged out users receive new messages. The problem is that when a user logs out of my app there is a time period where the webhook events still show that user as being logged.

In an attempt to fix this, I’ve added a hook in my app that is called when a user signs out of my app and it uses the `getDisconnect` selector like so:

```auto
import { getDisconnect } from '@sendbird/uikit-react/sendbirdSelectors'
import useSendbirdStateContext from '@sendbird/uikit-react/useSendbirdStateContext'
import { useCallback } from 'react'
import useAuth from './useAuth'

export const useSignoutOfEverything = () => {
  const { signOut } = useAuth()
  const sendbird = useSendbirdStateContext()

  return useCallback(() => {
    getDisconnect(sendbird)().then(() => signOut())
  }, [signOut, sendbird])
}

```

I thought this would explicitly disconnect the user from sendbird as they log out of my app, but I still get webhook events for `group_channel:message_send` which show `is_online: true` for the user for some period of time. I don’t get any console errors on the call for `getDisconnect(...)()` even when I have added extra logging and catches, so it appears that call is going through as expected.

Can anyone explain what is going on here? At a minimum, I’d like to know how long the timeout is before a user is reported as being `is_online: false` in webhook events. Thanks for your help.
