Skip to main content
The React Native SDK exposes two functions for presenting clickwrap content: show() (request consent) and showAcceptedContent() (re-display a previously accepted agreement). Both return Promises and use the native iOS / Android clickwrap dialogs under the hood.

Methods

show

function show(request: ClickwrapTemplateRequest): Promise<string | null>;
Fetches the current effective template, presents the clickwrap dialog, and resolves with the resulting Signature when the user accepts or declines. If the end user has already accepted the latest major version, no dialog is shown and the promise resolves with null. ClickwrapTemplateRequest fields:
FieldTypeRequiredDescription
clickwrapTemplateIdstringYesTemplate ID from the ClickTerm dashboard.
endUserIdstringYesYour identifier for the end user (max 256 chars).
templatePlaceholders{ ...standardFields, customPlaceholders?: Record<string, string> } | nullNoStructured placeholder object. Pass null or omit if not needed.
languagestringYesLanguage code (e.g. "en").
Example:
import * as Clickterm from '@clickterm/react-native-sdk';
import type { ClickwrapTemplateRequest } from '@clickterm/react-native-sdk';

const request: ClickwrapTemplateRequest = {
  clickwrapTemplateId: 'YOUR_TEMPLATE_ID',
  endUserId: 'user-123',
  templatePlaceholders: {
    fullName: 'Alice Example',
    email: '[email protected]',
    company: 'Acme Corp',
    customPlaceholders: {
      region: 'EMEA',
    },
  },
  language: 'en',
};

try {
  const signature = await Clickterm.show(request);
  if (signature === null) {
    // User already accepted the latest major version — no dialog shown
    return;
  }
  // Send the Signature to your backend for verification
  await sendToBackend(signature);
} catch (error) {
  console.error('show() failed', error);
}
show() resolves with null when the user has already accepted the latest major version — no dialog is presented and no new Signature is generated. This mirrors the Android SDK’s null Signature semantics.

showAcceptedContent

function showAcceptedContent(
  request: ClickwrapAcceptedAgreementRequest
): Promise<ClickwrapTemplateContent>;
Re-displays a previously accepted agreement. Resolves with the stored ClickwrapTemplateContent for the most recent acceptance. ClickwrapAcceptedAgreementRequest fields:
FieldTypeRequiredDescription
clickwrapTemplateIdstringYesTemplate ID from the ClickTerm dashboard.
endUserIdstringYesYour identifier for the end user.
ClickwrapTemplateContent fields:
FieldTypeDescription
clickwrapTemplateIdstringThe template’s ID.
clickwrapTemplateVersionnumberMajor version of the accepted content.
clickwrapTemplateVersionMinornumberMinor version of the accepted content.
titlestring | nullTemplate title (may be unset).
contentstringRendered HTML content of the agreement.
eventAcceptedTimestampstring | nullISO-8601 timestamp of the acceptance event.
templateLastUpdatedTimestampstring | nullISO-8601 timestamp of the template’s last update.
resolvedLanguagestring | nullLanguage code the content was resolved into.
Example:
import * as Clickterm from '@clickterm/react-native-sdk';
import type { ClickwrapAcceptedAgreementRequest } from '@clickterm/react-native-sdk';

const request: ClickwrapAcceptedAgreementRequest = {
  clickwrapTemplateId: 'YOUR_TEMPLATE_ID',
  endUserId: 'user-123',
};

try {
  const content = await Clickterm.showAcceptedContent(request);
  console.log(`Accepted v${content.clickwrapTemplateVersion}.${content.clickwrapTemplateVersionMinor}`);
} catch (error) {
  console.error('showAcceptedContent() failed', error);
}
Only works if the user has an accepted and verified event for this template.