Skip to main content
Credentials let you store login information (username/password, TOTP secrets) securely in Skyvern’s vault. Reference them by ID in tasks and workflows instead of passing secrets in your code.

createCredential

Store a new credential.
const credential = await skyvern.createCredential({
  name: "my-app-login",
  credential_type: "password",
  credential: {
    username: "demo@example.com",
    password: "s3cur3-p4ss",
  },
});
console.log(credential.credential_id);

Parameters

ParameterTypeRequiredDescription
namestringYesDisplay name for the credential.
credential_typeCredentialTypeYesType of credential.
credentialobjectYesThe credential data. Shape depends on credential_type.

Returns CredentialResponse


getCredentials

List all credentials. Credential values are never returned — only metadata.
const creds = await skyvern.getCredentials({});
for (const c of creds) {
  console.log(`${c.name} (${c.credential_id})`);
}

Parameters

ParameterTypeRequiredDefaultDescription
pagenumberNoundefinedPage number.
page_sizenumberNoundefinedResults per page.

Returns CredentialResponse[]


getCredential

Get a single credential’s metadata by ID.
const cred = await skyvern.getCredential("cred_abc123");
console.log(cred.name, cred.credential_type);

Parameters

ParameterTypeRequiredDescription
credentialIdstringYesThe credential ID.

Returns CredentialResponse


deleteCredential

Delete a credential.
await skyvern.deleteCredential("cred_abc123");

Parameters

ParameterTypeRequiredDescription
credentialIdstringYesThe credential ID to delete.

sendTotpCode

Send a TOTP (time-based one-time password) code to Skyvern during a run that requires 2FA. Call this when your webhook or polling detects that Skyvern is waiting for a TOTP code.
await skyvern.sendTotpCode({
  totp_identifier: "demo@example.com",
  content: "123456",
});

Parameters

ParameterTypeRequiredDescription
totp_identifierstringYesThe identifier matching the totp_identifier used in the task/workflow.
contentstringYesThe TOTP code value.
task_idstringNoAssociate with a specific task run.
workflow_idstringNoAssociate with a specific workflow.
workflow_run_idstringNoAssociate with a specific workflow run.
sourcestringNoSource of the TOTP code.
expired_atstringNoWhen this code expires (ISO 8601 format).
typeOtpTypeNoOTP type.

Returns TotpCode