import { MdxImage } from "@/components/MdxImage";

import EnvVar from "./env-variable.webp";
import Metadata from "./metadata.webp";
import ShareModal from "./share-modal.webp";
import Settings from "./single-use-setting.webp";
import Message from "./used-message.webp";

export const metadata = {
  title: "Single Use Links",
  description: "Make sure that each respondent only replies once with single use links.",
};

#### Link Surveys

# Single Use Links

This guide will help you understand how to generate and use single-use links within our application.

## Purpose

- Single-use links (or one-time / disposable links) are URLs that grant access to a survey only once.

- The primary purpose of single-use links is to assure that no respondent submits a survey twice.

## Using Single-Use Links with Formbricks

Using single-use links with Formbricks is quite straight-forward:

1. In the survey settings, toggle "Single Use Link" on:

   <MdxImage
     src={Settings}
     alt="Single use survey settings"
     quality="100"
     className="max-w-full rounded-lg sm:max-w-3xl"
   />

2. When you publish your survey, the following modal will open:
   <MdxImage
     src={ShareModal}
     alt="Share modal with 7 single use links which can be regenerated"
     quality="100"
     className="max-w-full rounded-lg sm:max-w-3xl"
   />

Here, you can copy and generate as many single-use links as you need.

## URL Encryption

You can encrypt single use URLs to assure information to be protected. To enable it, you have to set the correct environment variable:

<MdxImage
  src={EnvVar}
  alt="Set the right env var to be able to enable encryption."
  quality="100"
  className="max-w-full rounded-lg sm:max-w-3xl"
/>

## Check suId of a submission

You can find the suId of each submission in the submission meta data. To view it, simple hover over the Avatar:

<MdxImage
  src={Metadata}
  alt="View suId in the submission meta data."
  quality="100"
  className="max-w-full rounded-lg sm:max-w-3xl"
/>

### 'Link used' message

You can customize the 'link used' messaging in the Survey Editor settings:

<MdxImage
  src={Message}
  alt="Adjust the message shown to people if a link was already used."
  quality="100"
  className="max-w-full rounded-lg sm:max-w-3xl"
/>
