Locksmith
Install LocksmithContact us
  • Quick Start
  • 💡Basics
    • A Locksmith Overview
    • Creating locks
    • Creating keys
    • Compatibility with other apps and Shopify features
    • Removing Locksmith
  • 🔆Tutorials
    • Approving customer registrations
    • Creating restricted wholesale products
    • Hiding product prices and/or the add to cart button
    • Selling digital content on Shopify
    • More tutorials...
      • Setting up multiple price tiers
      • Customizing messages
      • Customizing the customer login page
      • Customizing the registration form
      • Customizing the passcode form
      • Customizing Locksmith’s "Access denied content" messages, and redirecting customers
      • Customizing the email list signup form
      • Showing multiple prompts on the same page
      • Showing content only to specific Markets
      • Input lists
      • Protecting against bots
      • Earn recurring revenue on your exclusive content using ReCharge
      • Use Locksmith and PayWhirl together to grant access based on subscriptions
      • Liquid locking basics
      • Restricting checkout from the cart
      • Confirmation key condition
      • Restricting customers to a specific collection
      • Passcode-specific redirects
      • Grow your subscriber lists with Klaviyo
      • Use Klaviyo as an access control list
      • Use Mailchimp to collect customer emails
      • Hiding out-of-stock products
      • How to use a private browsing session
      • Granting access to variants by visitor input
      • Offering different variants by postal code
      • Locking products by tag
      • Locking multiple pages at once
      • Making a product accessible exclusively from the direct product link
      • Creating private team areas
      • Importing customers in bulk
      • Disabling Locksmith for certain theme files
      • Adding translations to your Locksmith messages
      • Redirecting using Locksmith
      • Locking variants
        • Limiting the scope of variant locks using the product tag key condition
        • Handling JavaScript DOM errors caused by variant locks
      • Locking the customer registration form
      • Locking the search results page in your store
      • How to clear cache for a single website
      • Disabling Locksmith for certain theme files
      • 🛠️Manual mode
      • Grant access for a limited time when using passcodes or secret links
      • Testing Locksmith on unpublished themes
      • Locking blog posts
      • How to access your browser's dev tools
      • Restricting the cart for mixed products and combinations of products
      • Locking products by vendor
      • How do I hide my Shopify store's header and footer
      • Hiding navigation links for locked resources
      • Hiding products from product-grids
      • Restricting a product so that it can only be purchased by new customers
      • Automatically managing the seo.hidden metafield using Locksmith
      • Locking the home page
      • Setting up checkout validation with Locksmith
      • How to hide theme sections, blocks, and snippets
  • 🔑Keys: Access methods in Locksmith
    • About key conditions
    • Customer account keys
    • Passcode keys
    • Secret link keys
    • Visitor location keys
    • More about keys...
      • Inverting conditions in Locksmith
      • Combining key conditions
      • "Has purchased..." key
      • Using the "Force open other locks" setting
      • Custom Liquid key-condition basics
      • Manual mode
      • Excluding content from locks
      • IP address keys
      • Newsletter keys
      • Limiting the scope of variant locks using the product tag key condition
  • 🌻FAQs
    • Why aren't my locks working?
    • FAQ: I see blank spaces in my collections and/or searches when locking
    • Can Locksmith hide content from my in-store search?
    • Locksmith is not working with my page builder app
    • What should I do if my site is loading slowly?
    • I'm the administrator of my site and I cannot access pages because of Locksmith locks.
    • More FAQs...
      • I'm having trouble using Locksmith with a site speed optimization app.
      • The app isn't loading. What do I do?
      • Can Locksmith protect shipping methods, billing methods, or coupon codes?
      • I switched themes, and Locksmith isn't working
      • Why isn't my passcode, secret link, newsletter, or location key working?
      • Can Locksmith lock Shopify's public JSON API for my online store?
      • Why are my customers seeing a reCAPTCHA when logging in?
      • My passcode or newsletter prompt is not updating on my store when I change it.
      • My featured collections on my home page only show one product.
      • My infinite scrolling doesn't show all of my products.
      • My customers have to enter their e-mail address into the Mailchimp key every time they visit.
      • How do I know which customers have used a certain key?
      • Why is Locksmith adding information to my orders?
      • Locksmith isn't installing correctly!
      • Locksmith is not uninstalling correctly!
      • How does Locksmith affect search engines and SEO?
      • How do I change where customers are redirected to after registration on Shopify
      • The thing I want to lock isn't showing up in the Locksmith search
      • I am getting an "already taken" error when trying to create a metafield definition for seo.hidden
      • How do I add a hero banner image to Locksmith's access messages
  • 📒Policies
    • Usage agreement
    • Locksmith's pricing policy: Pay what feels good
    • Privacy policy
    • Data policy
    • Contact us
  • 🔦Developer Tools
    • Locksmith Admin API
    • Locksmith Storefront API
    • Locksmith variables
    • Unsupported functionality
    • Requests from Locksmith
  • More developer docs...
    • Using the Admin API with Locks
  • App Integrations
    • Easy Appointment Booking
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Basics

Creating keys

Explore the types of key conditions that Locksmith makes available to you!

PreviousCreating locksNextCompatibility with other apps and Shopify features

Last updated 5 months ago

Was this helpful?

Once you , you'll need to create keys – simple statements that describe the conditions for access. For example, one might have a key that says "Permit if the customer is signed in". In this example, the key condition is "if the customer is signed in".

Keys are added, unsurprisingly, inside of the "Keys" section on the lock page:

Press that "Add the first key" button, and you'll be presented with the full list of key conditions that are available to you. There are quite a few options here!

These are all the key conditions that Locksmith supports:

Permit if the customer...

  • is signed in This condition requires all customers to log in with a customer account. Once they're logged in, they'll be granted access to the locked resource. (When inverted: unless the customer is signed in)

  • is tagged with… This condition first requires all visitors to log in with a customer account, by presenting your store's usual login form. (If that login form includes a link to customer registration, it'll be included here, too.) Once the customer has logged into their account, they'll be granted access if their customer account has the tag you've chosen in Locksmith. (When inverted: unless the customer is tagged with..., or is not signed in)

  • gives the passcode… This condition prompts the visitor to enter a passcode, which must match the passcode you configure. If they don't enter a matching passcode, they'll be given the same prompt again.

  • gives one of many passcodes… This condition allows you to configure a group of passcodes, and will grant access if the visitor is able to provide one of the passcodes on that list.

  • arrives via a secret link… This condition generates a "secret" URL for the locked resource, containing a secret code. If the visitor arrives via that link, they'll be granted access. If they use any other link, they will be denied access.

  • subscribes to your Mailchimp list This condition connects to your Mailchimp account, and grants access once a visitor has provided their email address, adding that address to your Mailchimp list.

  • subscribes to your Klaviyo list This condition connects to your Klaviyo account, and grants access once a visitor has provided their email address, adding that address to your Klaviyo list. This option can be configured to only allow access if the submitted email address is already on that Klaviyo list.

  • has one of many email addresses This condition requires the visitor to be logged in with their customer account, prompting them to log in if they aren't already. If their email address is on the list that you specify, they'll be granted access.

  • has an email address from an input list… This condition requires the visitor to be logged in with their customer account, prompting them to log in if they aren't already. If their email address is on the input-list that’s specified on the key condition and has been previously synced with Locksmith, they'll be granted access.

  • the customer's email contains… This condition requires the visitor to be logged in with their customer account, prompting them to log in if they aren't already. If their email address matches some text that you specify (say, "@mycompany.com"), they'll be granted access.

  • has purchased… This condition requires the visitor to be logged in with their customer account, prompting them to log in if they aren't already. If their last 50 orders contain a certain product (identified by SKU, title, or by product tag), they'll be granted access.

  • has placed at least x orders This condition requires the visitor to be logged in with their customer account, prompting them to log in if they aren't already. If their lifetime order count is at least the number that you specify, they'll be granted access.

  • has a certain product in their cart This condition scans the visitor's current cart, and grants access if a certain product is found.

  • has a certain variant in their cart This condition scans the visitor's current cart, and grants access if a certain product variant is found.

  • has at least $x in their cart This condition checks the subtotal of the visitor's current cart, and grants access if the total is at least a certain amount.

  • has a certain IP address This condition checks the visitor's IP address. If it matches the address or range that you specify, they'll be granted access.

  • is visiting before a certain date and time This condition checks the current time, and grants access if it's before the time that you specify.

  • is visiting after a certain date and time This condition checks the current time, and grants access if it's after the time that you specify.

  • is visiting a certain domain This condition checks the domain of your store, and grants access if the visitors domains matches up . This is useful if you have multiple domains on your store that might be scoped to different regions of the world (or any other reason you have for creating multiple domains.

  • the customer confirms the prompt This is a straightforward key condition that allows access solely based on if the customer confirms the prompt that you set.

  • (always permit) This is a special condition! It's useful when "forcing open" a lock, under some certain circumstances. To learn more about this, see: Excluding content from locks

  • (custom Liquid) This condition allows you to write custom Liquid code, granting access if your Liquid condition evaluates to "true". This is the most powerful key condition, because it allows you to grant access under any circumstances that you can determine using Liquid.

Related articles

More information on how to combine key conditions together is covered in our "Overview" guide here:

Remember that all key conditions can be inverted!

Having issues with locks overlapping? Perhaps the "Force open other locks" setting is for you:

gives a passcode from an input list… This condition works the same way as the other passcode conditions, except that it uses an input list as the passcode source, making this key condition suitable for bulk passcodes. ()

arrives using a secret link code from an input list… This condition works the same way as the other secret link key condition, except that it uses an input list as the passcode source, making this key condition suitable for bulk passcodes. ()

is visiting from a certain location (city, country, etc) This condition uses the visitor's IP address to estimate their location, matching it with a location that you define ahead of time. (Under the hood, this condition uses to estimate visitor locations.)

💡
For more on this, see Input lists.
For more on this, see Input lists.
GeoIP by MaxMind
Combining key conditions
Inverting conditions in Locksmith
Using the "Force open other locks" setting
create a lock