# How to subscribe to addWordToUserDictionary and deleteWordFromUserDictionary action

There are separate callback functions available such as **onAddWordToUserDictionary** and **onDeleteWordFromUserDictionary**, that you can use to get information about newly added or removed words from the personal user dictionaries.

```javascript
</script>
window.WEBSPELLCHECKER_CONFIG = {
    ...
    onAddWordToUserDictionary: function(word, instance) {
        console.log(word);
    },
    onDeleteWordFromUserDictionary: function(word, instance) {
        console.log(word);
    }
};
</script>
```

For the versions of the package before release 5.5.8, there is a temporary workaround available if you need to listen to Add or remove word actions performed by end users.

```javascript
<script>
window.WEBSPELLCHECKER_CONFIG = {
    autoSearch: true,
    ....,
    onLoad: function(instance) {
        instance.subscribe('addWordToUserDictionary', function(data) {
            // Get the added `word` from `data.word` field
        });

        instance.subscribe('deleteWordFromUserDictionary', function(data) {
            // Get the deleted `word` from `data.word` field
        });
    }
};
</script>
```


---

# 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.wproofreader.com/v6.12.0/integrations/how-tos/how-to-subscribe-to-addwordtouserdictionary-and-deletewordfromuserdictionary-action.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.
