> For the complete documentation index, see [llms.txt](https://www.locksmith.guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.locksmith.guide/tutorials/more/granting-access-to-variants-by-visitor-input.md).

# Granting access to variants by visitor input

Locksmith's variant locking feature results in automatic hiding of variants that the visitor doesn't have access to. If you're using keys that are based on things that don't require customer input (say, "permit if the customer is signed in"), then revealing those variants is automatic: if the customer qualifies, the variants appear.

If you're using keys that require visitor input, like passcodes or email addresses, then an intermediate step needs to be added to the customer experience, allowing them to actually *enter* their information. This doesn't happen automatically, and without it, the visitor won't have a way of accessing the hidden variants.

## Setup

### 1. Create a dedicated "sign in" page

In the Shopify admin area, head to the "Online Store" section, and open up your "Pages" list. Create a page that's just for customers who are shopping the particular variant(s) that you want to help them unlock. Add menu links to this page, if necessary and where appropriate.

### 2. Lock the page

Back in Locksmith, search for the page, and create a lock for it.

### 3. Add a passcode key to the page lock, using the same passcode as your variant lock

Here's where it comes together: by adding a passcode key that uses *the same* passcode as your variants, the customer's successful passcode entry *here* will result in the variant locks automatically opening, because they'll register the presence of the same passcode.

A bonus, if you're using multiple variant locks: Because locks can have multiple keys, there's an opportunity here for you to add multiple passcode keys here, one for each of the different variant locks you've got. This is a useful strategy if you're preparing variants for separate audiences - this allows you to have a single "sign in" page, where everyone can gain access to their respective variants.

### 4. Optional: configure the key to redirect to your product

If you like, add an automatic redirect to the key, routing the customer to the right product page when they enter the right passcode. Click the pencil icon on the key to edit it, and fill in **Redirect URL (optional)** at the bottom.

As noted in step 3, this *also* works with multiple passcode keys. Simply add the right redirect to each passcode key, and the customers will be routed to the right place after entering their passcode.

![](https://d33v4339jhl8k0.cloudfront.net/docs/assets/5ddd799f2c7d3a7e9ae472fc/images/5f8a4847cff47e001a58f678/file-1ODFjAHu83.png)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.locksmith.guide/tutorials/more/granting-access-to-variants-by-visitor-input.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
