diff --git a/src/connections/functions/destination-functions.md b/src/connections/functions/destination-functions.md index ae56dfd98f..f109a68a4a 100644 --- a/src/connections/functions/destination-functions.md +++ b/src/connections/functions/destination-functions.md @@ -79,6 +79,12 @@ To change which event type the handler listens to, you can rename it to the name > info "" > Functions' runtime includes a `fetch()` polyfill using a `node-fetch` package. Check out the [node-fetch documentation](https://www.npmjs.com/package/node-fetch){:target="_blank"} for usage examples. +### Variable scoping + +When declaring settings variables, declare them in the function handler rather than globally in your function. This prevents you from leaking the settings values across other function instances. + +The handler for destination functions is event-specific. For example, you might have an `onTrack()`or `onIdentify()` function handler. + ### Errors and error handling {% include content/functions/errors-and-error-handling.md %}