Skip to content

feat(turbosign): support conditional (IF/THEN) fields across all SDKs - #71

Merged
amitsharma-turbodocx merged 3 commits into
mainfrom
feature/turbosign-conditional-fields
Aug 19, 2026
Merged

feat(turbosign): support conditional (IF/THEN) fields across all SDKs#71
amitsharma-turbodocx merged 3 commits into
mainfrom
feature/turbosign-conditional-fields

Conversation

@amitsharma-turbodocx

Copy link
Copy Markdown
Contributor

Summary

Adds support for TurboSign conditional (IF/THEN) fields to all six SDKs. A signature field can now carry an optional metadata object so a controlling checkbox drives a dependent field:

  • On a checkbox field: metadata.fieldKey — a stable id.
  • On a dependent field: metadata.conditional = { controllingFieldKey, operator, action }
    • operator: "is_checked" | "is_not_checked"
    • action: "show" (hidden until met) | "unlock" (visible but read-only until met)

It flows through the single-step sendSignature / createSignatureReviewLink routes and rides along in the already-serialized fields payload — no new serialization path.

What changed

Implemented consistently across JS/TS, Python, Go, PHP, Java, Ruby: the metadata/conditional types (typed where the language is typed, pass-through where dynamic), advanced examples, README "Field Types" sections, and tests. The controlling checkbox type already existed in every SDK.

Verification

  • JS/TS: npm test (54 pass) + tsc build green.
  • Go / PHP / Java / Ruby / Python: build + tests run in CI.

Notes

Part of a coordinated conditional-fields rollout across the TurboDocx public repos (Docs, n8n node, quickstart) — sibling PRs linked in a follow-up comment.

A signature field can now carry an optional `metadata` object that makes it
depend on a controlling checkbox: set `metadata.fieldKey` on a `checkbox` field,
and `metadata.conditional` = { controllingFieldKey, operator, action } on a
dependent field. `operator` is "is_checked" | "is_not_checked"; `action` is
"show" (hidden until met) | "unlock" (visible but read-only until met). It flows
through the single-step prepare-for-signing / prepare-for-review routes and rides
along in the already-serialized fields payload.

Implemented consistently in all six SDKs (JS/TS, Python, Go, PHP, Java, Ruby)
with matching types, examples, README sections, and tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@amitsharma-turbodocx

Copy link
Copy Markdown
Contributor Author

Coordinated conditional-fields rollout — sibling PRs: TurboDocx/n8n-nodes-turbodocx#31 · TurboDocx/Docs#150 · TurboDocx/quickstart#24

… SDKs

A dedicated, runnable example per language (JS/TS, Python, Go, PHP, Java, Ruby)
showing a checkbox that controls other fields: three controlling checkboxes drive
four dependents across show/unlock and is_checked/is_not_checked, including one
checkbox driving two dependents, plus a plain required signature. Uses
createSignatureReviewLink (no emails sent) and notes the InvalidConditionalRule
400 and the fail-open behavior.

All six author the identical wire shape — metadata.{fieldKey,
conditional{controllingFieldKey, operator, action}} — verified against the JS SDK
run end-to-end against the API. JS typechecks and Python compiles locally; the
typed SDKs are written to their real types (Go structs, PHP enums, Java
FieldMetadata factories) and build in CI.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread packages/js-sdk/examples/turbosign-conditional-fields.ts Dismissed
php-cs-fixer's ensure_fully_multiline requires one named argument per line on a
multi-line call. The four dependent-field new Field(...) constructors had their
args wrapped two-to-a-line, which failed the cs-fix --dry-run check. Reformat them
one-arg-per-line to match; the single-line checkbox constructors are unaffected.
No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@amitsharma-turbodocx
amitsharma-turbodocx merged commit 77cdf61 into main Aug 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant