rotateSecretKey()
Rotates the secret key for the given machine.
Returns the new secret key.
function rotateSecretKey(params: RotateMachineSecretKeyParams): Promise<MachineSecretKey>- Name
-
previousTokenTtl - Type
number- Description
The time in seconds that the previous secret key will remain valid after rotation. This ensures a graceful transition period for updating applications with the new secret key. Set to
0to immediately expire the previous key. Maximum value is28800seconds (8 hours).
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