[**Documentation**](../../../../README)

***

[Documentation](../../../../README) / [@zerotal/admin](../../README) / [index](../README) / startImpersonating

# Function: startImpersonating()

> **startImpersonating**(`userId`): `Promise`\<\[`true`\] \| \[`false`, `string`\]\>

Defined in: [admin/src/impersonation.ts:83](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/admin/src/impersonation.ts#L83)

Become `userId`, remembering who to come back as.

Refuses to start a second impersonation on top of a first: nesting makes
"stop" ambiguous, and there is no case where it helps.

## Parameters

### userId

`unknown`

## Returns

`Promise`\<\[`true`\] \| \[`false`, `string`\]\>
