rotateSecretKey()
Rotates the machine secret key for a given machine by its ID.
function rotateSecretKey(params: RotateMachineSecretKeyParams): Promise<MachineSecretKey>
- Name
machineId
- Type
string
- Description
The ID of the machine for which to rotate the secret key.
- Name
previousTokenTtl
- Type
number
- Description
The time in seconds that the previous secret key will remain valid after rotation.
const machineId = 'mch_123'
const response = await clerkClient.machines.rotateSecretKey({
machineId,
previousTokenTtl: 3600,
})
Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint POST/machines/{machine_id}/secret_key/rotate
. See the BAPI reference for more information.
Feedback
Last updated on