CML
    Preparing search index...

    Function validateCmcdEvents

    • Validates a raw CMCD string as an event-mode payload.

      This function decodes the string internally and validates it with reportingMode set to 'event'. The input may contain multiple newline-separated events (e.g. a text/cmcd POST body), in which case each line is validated independently and the results are merged.

      Parameters

      • cmcd: string

        The raw CMCD-encoded string to validate. May contain multiple newline-separated event lines.

      • Optionaloptions: Omit<CmcdValidationOptions, "reportingMode">

        Validation options (excluding reportingMode).

      Returns CmcdEventsValidationResult

      The validation result including decoded data per event line.

      		const body = `e=ps,sid="session-1",ts=1700000000000,sta=p,v=2
      e=t,sid="session-1",ts=1700000001000,bl=(5000),v=2`

      const result = validateCmcdEvents(body)
      equal(result.valid, true)
      deepStrictEqual(result.issues, [])