Acceptance flow
Retrieve T&C document info
After initializing the SDK, fetch the current Terms & Conditions document for the authenticated user:
Display the document
Use Alternatively, embed the document in an iframe for an in-app experience:
terms.documentUrl to show the document to the user. You can open it in a new tab:Handling T&C version updates
When Squire publishes a new version of the Terms & Conditions,getTermsAndConditionsDocumentInfo() automatically returns the new version with an updated documentUrl and isAccepted set to false. Users who accepted a previous version must accept the new one before they can record again. Run the same acceptance flow described above whenever isAccepted is false.
API reference
getTermsAndConditionsDocumentInfo()
Returns a promise that resolves with information about the current Terms & Conditions document.
| Property | Type | Description |
|---|---|---|
uuid | string | Unique identifier of the T&C document version |
documentFilename | string | Filename of the T&C document |
documentUrl | string | URL where the T&C document can be downloaded or displayed |
createdDt | Date | Date the document version was created |
acceptedDt | Date | null | Date the user accepted the terms, or null if not yet accepted |
isAccepted | boolean | Whether the current user has accepted this version |
accept() | () => Promise<void> | Records the user’s acceptance of the current document |