# Events

NearFi currently supports 3 event types

* `signIn`: emitted when the current NearFi wallet account is connected to user application
* `signOut`: emitted when the user disconnects/sign-outs the wallet from the application
* `accountChanged`: emitted when the wallet user switches from the current wallet to another wallet

Code examples

```javascript
//register
window.nearFiWallet.on("signIn", function() => {
    //write code to proceed after signing in
})
window.nearFiWallet.on("signOut", function() => {
    //write code to proceed after signing out
})
window.nearFiWallet.on("accountChanged", function() => {
    //reload when account changed
    window.location.reload()
})

//remove events
window.nearFiWallet.remove("signIn")

//register event for once used when the application only wants 
// to listen to the first event instance
window.nearFiWallet.once("signIn", function() => {
    //write code to proceed after signing in
})
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nearfi.finance/developer-guide/integrate-nearfi-dapp-browser-into-your-app/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
