Setup Legal Documents (optional)

To prompt users to review and accept your policies, like Terms and Conditions, Privacy Policy, or Cookie Policy, VeChainKit offers a simple plug-and-play solution.

You can avoid building your own if you haven't already.

By enabling also the tracking consent, you will allow VeChainKit to prompt your users to collect data to improve the kit.


When the legalDocuments option is configured, the users will see:

  • Left: A modal prompt when connecting their wallet, requiring them to review and accept required and optional legal documents.

  • Right: A summary view under Settings > General > Terms and Policies, showing which policies they’ve accepted and when.

Legal Docs Modal
Legal Docs Summary View

Important

Legal document agreements are tied to the wallet address, document type, document version, and the url.

  • If the version of any document is updated, users will be prompted to accept it again.

  • Agreements are stored in the browser’s local storage, meaning acceptance is per browser and device.

  • As a result, users may be prompted again if they switch browsers, devices, or clear their local storage even if they've previously agreed on another setup.

import { VechainKitProvider } from '@vechain/vechain-kit';

export default function App({ Component, pageProps }: AppProps) {
    return (
        <VechainKitProvider
            legalDocuments={{
                allowAnalytics: true, // Enables optional consent for VeChainKit tracking

                cookiePolicy: [
                    {
                        displayName: 'MyApp Policy', // (Optional) Custom display label
                        url: 'https://www.myapp.com/cookie-policy',
                        version: 1, // Increment to re-prompt users
                        required: false, // Optional: User sees a checkbox to opt in
                    },
                ],

                privacyPolicy: [
                    {
                        url: 'https://www.myapp.com/privacy-policy',
                        version: 1, // Increment to re-prompt users
                        required: false, // Optional: can be skipped or rejected
                    },
                ],

                termsAndConditions: [
                    {
                        displayName: 'MyApp T&C',
                        url: 'https://www.myapp.com/terms-and-conditions',
                        version: 1, // Increment to re-prompt users
                        required: true, // Required: must be accepted to proceed
                    },
                ],
            }}
            // ... other props
        >
            {children}
        </VechainKitProvider>
    );
}

Key Options

Option
Type
Required
Description

allowAnalytics

boolean

No

If true, prompts users with an optional tracking policy.

cookiePolicy

array

No

One or more cookie policy versions.

privacyPolicy

array

No

One or more privacy policy versions.

termsAndConditions

array

No

One or more T&C versions.

Last updated

Was this helpful?