> For the complete documentation index, see [llms.txt](https://seoul-labs.gitbook.io/zigap-utils/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seoul-labs.gitbook.io/zigap-utils/hooks/usezigap.md).

# useZigap

`useZigap` is a hook that fetches the information of the logged-in user in the zigap app and provides a logout function.

### Usage

```
import { useZigap } from 'zigap-utils';
```

### Example

```typescript
import { useZigap } from 'zigap-utils';

...

const Component = () => {
  const { userInfo, logout, isWindowLoaded } = useZigap();
  
  const handleLogout = () => {
    if(isWindowLoaded) {
      logout();
      window.location.reload();
    }
  }
    
  return (
    <div>
      <p>Address: {userInfo.address}</p>
      <p>Network: {userInfo.network}</p>
      <p>Nickname: {userInfo.nickName}</p>
      <p>Token: {userInfo.token}</p>
      <p>Issued DateTime: {userInfo.issuedDateTime}</p>
      <p>Expire DateTime: {userInfo.expireDateTime}</p>
      
      <button onClick={handleLogout}> LOGOUT </button>
    </div>
  );
}



```

#### UserInfo

| name           | type                |
| -------------- | ------------------- |
| address        | string \| undefined |
| network        | string \| undefined |
| nickname       | string \| undefined |
| token          | string \| undefined |
| issuedDateTime | string \| undefined |
| expireDateTime | string \| undefined |

#### logout

It is a function that delete only the stored local storage value. Refresh the page if necessary.
