> For the complete documentation index, see [llms.txt](https://bayun.gitbook.io/bayuncoresdk-javascript-programming-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bayun.gitbook.io/bayuncoresdk-javascript-programming-guide/3-authentication/5.6-change-password.md).

# 5.6 Change Password

To change password for a user on Bayun, use `changePassword` function.

The function takes the following parameters

* **sessionId** : Unique SessionId which is received in the login/registration function response.
* **currentPassword** : Current Password.
* **newPassword** : New Password.
* **successCallback** : Success block to be executed after successful password change.
* **failureCallback** : Failure block to be executed if password change fails, returns `BayunError`.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
const successCallback = data => {
  //Password Changed Successfully 
};

const failureCallback = error => {
  console.error(error);
};

bayunCore.ChangePassword(
    sessionId,
    "<currentPassword>",
    "<newPassword>",
    successCallback,
    failureCallback
)
```

{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

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

```
GET https://bayun.gitbook.io/bayuncoresdk-javascript-programming-guide/3-authentication/5.6-change-password.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.
