> For the complete documentation index, see [llms.txt](https://docs.servoy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.servoy.com/reference/servoyextensions/browser-plugins/home-2.md).

# Idle

Welcome to the svyIdle wiki!

## Introduction

Simple web service to check if a user is idle or if browser window no longer active (NGclient only)

## Example Usage

```js

//setup callback functions for different events

/**
 * @properties={typeid:24,uuid:"E6949E1C-AA93-4145-9509-BF10CA66AC02"}
 */
function idle() {		
	application.output('im idle...');
}

/**
 * @properties={typeid:24,uuid:"09584FE2-2B10-420A-B685-A9A988A6261A"}
 */
function active() {	
	application.output('im active...');
}

/**
 * @properties={typeid:24,uuid:"06ACAC5D-4D1C-49BD-B786-3E9496DA3860"}
 */
function hide() {
	application.output('window hidden');
}

/**
 * @properties={typeid:24,uuid:"1A268EDF-BA18-4E67-A049-6E1305E08D72"}
 */
function show() {
	application.output('window shown');
}

//Then call the onIdle method and pass in callback methods to execute when idle or when windows become hidden/active.
plugins.svyIdle.onIdle(idle,active,hide,show,null,5000,true,false,false);
});
```

## API

### Method Summary

#### onIdle

execute service

**Params**

| Type     | Name          | Summary                                                                                         | Required |
| -------- | ------------- | ----------------------------------------------------------------------------------------------- | -------- |
| Function | onIdle        | triggers when user is idle                                                                      | Optional |
| Function | onActive      | triggers when user is active                                                                    | Optional |
| Function | onHide        | triggers when window is hidden                                                                  | Optional |
| Function | onShow        | triggers when window is shown                                                                   | Optional |
| String   | events        | string of events that will reset idle time (default : 'mousemove keydown mousedown touchstart') | Optional |
| Number   | idle          | idle time in ms before activating trigger, default: 60000                                       | Optional |
| Boolean  | keepTracking  | set to false if we only want to track the first time (true by default)                          | Optional |
| Boolean  | startAtIdle   | if you want to start at idle, set to true                                                       | Optional |
| Boolean  | recurIdleCall | use setInterval versus timeout, by default uses setTimeout                                      | Optional |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.servoy.com/reference/servoyextensions/browser-plugins/home-2.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
