# updateUserId()

Function that changes the current user session to the new ID specified.

<table><thead><tr><th width="156" align="center">Parameter</th><th width="156.33333333333331" align="center">Type</th><th>Description</th></tr></thead><tbody><tr><td align="center"><code>newUserId</code></td><td align="center"><code>string (optional)</code></td><td>New user ID to change to. If not specified, Feathery will generate a new unique ID.</td></tr><tr><td align="center"><code>merge</code></td><td align="center"><code>boolean (optional)</code></td><td>If <code>merge</code> is <code>false</code> or not specified, the user session will be changed. If <code>merge</code> is <code>true</code>, the old and new user sessions will be merged into a single session. This means data like field values and user metrics will also be merged.</td></tr></tbody></table>


---

# 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.feathery.io/develop/react/api-guide/updateuserid.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.
