Skip to main content

JavaScript

Official

Framework-agnostic core that powers the browser, Node, and platform SDKs.

API reference

Every export is fully typed. The signatures and props below come from the package's own reference documentation, so what is listed here is what the installed version ships.

Flows
Functions
User
exportEmbedded Recovery Flow (V2)

executeEmbeddedRecoveryFlowV2 drives a step-by-step account recovery flow (e.g., password reset) without a browser redirect.

Parameters
config.urlrequired
string

Full endpoint URL. Mutually exclusive with `baseUrl`

config.baseUrlrequired
string

ThunderID base URL

config.payloadrequired
EmbeddedRecoveryFlowRequestV2

Flow request body

config.payload.applicationIdoptional
string

Application ID. Required for the first step

config.payload.flowTypeoptional
string

Recovery flow type (e.g., `'PASSWORD_RECOVERY'`). Required for first step

config.payload.executionIdoptional
string

Execution ID from a prior response

config.payload.actionoptional
string

Action to take at the current step

config.payload.inputsoptional
Record

Step input fields

config.payload.challengeTokenoptional
string

Challenge token from a prior step

Example
import { executeEmbeddedRecoveryFlowV2, EmbeddedRecoveryFlowStatusV2 } from '@thunderid/javascript'

// Step 1 — Initiate recovery
const step1 = await executeEmbeddedRecoveryFlowV2({
  baseUrl: 'https://localhost:8090',
  payload: {
    applicationId: '<your-app-id>',
    flowType: 'PASSWORD_RECOVERY',
  },
})

// Step 2 — Provide the username/email to recover
const step2 = await executeEmbeddedRecoveryFlowV2({
  baseUrl: 'https://localhost:8090',
  payload: {
    executionId: step1.executionId,
    inputs: {
      username: 'user@example.com',
    },
  },
})

// Step 3 — Submit the OTP/token received by email
const step3 = await executeEmbeddedRecoveryFlowV2({
  baseUrl: 'https://localhost:8090',
  payload: {
    executionId: step2.executionId,
    inputs: {
      otp: '123456',
    },
    challengeToken: step2.challengeToken,
  },
})

if (step3.flowStatus === EmbeddedRecoveryFlowStatusV2.Complete) {
  // Recovery complete — prompt user for new password
}
ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.