---
title: HypeXAPI.setDefaultActor
slug: hypexapisetdefaultactor
description: Learn how to use the setDefaultActor function in JavaScript to set a default actor for future operations, ensuring consistency in all actions performed. Pass in the actor object to be set as the default and understand how this function works in conjunctio
docTags: 
createdAt: 2022-05-04T09:44:03.000Z
---

The setDefaultActor function sets the default actor to be used in future operations. This is useful if you want to ensure that all operations are performed by the same actor.

To use this function, simply pass in the actor object that you want to use as the default.

Keep in mind that if you download the xapiwrapper from an LRS, the default actor may already be set up.

```javascript
HypeXAPI.setDefaultActor({
    "objectType": "Agent",
    "name": "John Doe",
    "mbox": "mailto:john.doe@example.com"
});
```



