Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
There are many instances in which it is useful for a key to grant access if the opposite of your key condition is true.
Locksmith makes it easy to invert keys. To do so, simply click the box next to "invert" when you're editing the key:
Notice that when this is done, the wording will update, inverting the key condition logic:
Make sure to "Save" the lock, and you're done!
As always, feel free to contact us via email at [email protected].


Check the following or simply use the search bar in the header to quickly find the topic that you're looking for!
At times, you'll want to permit visitors to access a resource if several conditions are met. This can be a method of increasing security: you might, for example, require visitors to arrive at your sale collection via a secret link, but then you'll want them to also provide their personal passcode.
All of Locksmith's key conditions can be combined with all other key conditions. (For the full list, see Types of key conditions.) This is powerful! It means you can start to chain pieces of authorization logic together, to achieve really specific results.
To configure a combination key, begin by creating a standard key using whatever your first condition ought to be. Then, use the "Edit" link (shown next to the condition description). Scroll down to "+ Add key condition". Locksmith will prompt you to add a second condition, which you then configure in exactly the same way as the first.
Note that you'll see another "+ Add key condition" link, appearing in the key settings of your second condition. Yes, you may continue chaining conditions as needed – there are no limits here. :)
Using the example from earlier, in which a secret link condition is combined with a passcode condition, here's a demonstration:

How to use Locksmith's "always permit" key condition to make sure your some of your content doesn't become locked
This is useful if you have a lock on a collection, but want specific products still available. Or if you have a lock on your "entire store", but want specific pages always accessible.
It's a quick setup: you'll actually create a lock directly on the content that you want to be unlocked. This can be anything such an entire collection, a product, page, blog, etc.
Once you've added the lock, use the key condition labelled "always permit":
Save the lock, and you're done.
The "lock" that you've just created becomes a sort of anti-lock, so the product, collection, etc that you've placed it one will now always be available.
You may need to create multiple locks like this if you have multiple areas of your store that you would like to remain accessible.
The force open other locks setting is useful if you have multiple locks with overlapping content. This usually means locked collections with some of the same products. If this is you, check out our guide here:
Use Locksmith to only grant access to customers that subscribe to your newsletter
Locksmith allows you to integrate directly with either Mailchimp or Klaviyo. When setup, Locksmith will ask customers for an email address when they arrive on a locked page. Once the email is entered, a customer is immediately granted access, and Locksmith will automatically send the subscription information to the corresponding service.
How to deal with multiple overlapping locks preventing customers from accessing the content inside them
This setting is useful if you have multiple Locksmith locks that cover overlapping content (e.g. collection locks with some of the same products), and want to make sure that each lock grants full access to the content it covers, without other locks preventing access.
To turn on the "Force open other locks" setting, go to each applicable (overlapping) lock and follow these steps:
It is found directly under your keys in the section labelled "Key options":
You'll also notice that the the key shows a message telling you which keys are forcing open other locks.
Note: Since this is a key-specific setting, if you have multiple keys, make sure it is turned on for each key. Each key has its own key icon, so that's a quick way to tell if you have multiple keys.



Detailed information on how to setup Mailchimp can be found here:
If using Klaviyo, you have the option to simply request that visitors subscribe in order to gain access:
Or, you can also use Klaviyo to grant access only to those who are already subscribed to a specific list in your Klaviyo account:
Shopify ships out of the box with a marketing mailing list service. If you would like to use Locksmith to grant access to those who have already subscribed to this, you can do so using a custom Liquid key condition.
This is slightly different than the above options, in that it will only grant access to a signed in customers - if the customer is already subscribed! To start, check out our guide on this here:
The condition you're looking for is:
{% if customer.accepts_marketing %}
When set up, this will present the customer will the regular prompt to sign in (as opposed to the subscription prompt):
If desired, you can adjust your message prompt to direct your customers to the page footer(in most stores) to subscribe to your newsletter. More information on editing messages here:
Locksmith does not support other mail services at this time.
However, if you have a mail service that automatically tags customers that are subscribed, you can use Locksmith to check for a customer tag:
Please feel free to contact us via email at [email protected] if you have any questions!


Locksmith supports permitting visitors based on their IP address.
Start by opening the settings for a lock you've created. Then, follow the steps shown to add a key that permits "if the customer has a certain IP address", as shown below:
This key can be configured with a series of IP addresses, one given per line. It can also be configured with CIDR definitions, allowing you to specify entire subnet ranges.
This key condition can be inverted, resulting in a condition that permits unless the visitor has a certain IP address. When used with a lock on your entire online store, this is a useful way to block certain visitors.
To accomplish this, invert the key condition, as shown below by clicking on the checkbox next to "invert". (To learn more about inverting conditions, see .)
Because of the way IP address detection works, a IP address key on your entire store will show everyone a spinner graphic for a moment, before your store's content is loaded. This will only happen once, if the visitor has an accepted IP address.
Important: When used, this key condition has the potential to negatively affect the SEO of any content that is locked in this way. .
By default, Locksmith's variant locks apply to all matching option/value combinations. For example, you'll typically see something like this:
Once a variant lock is created, you can limit which products it applies to by using the key condition labelled "If the product is tagged with":
You'll use any existing product tags to denote which products you want the variant lock to apply to, or create new product tags if needed.
If you want the lock to apply to variants on one product tag only, and leave all other products untouched, for example, you'll use an inverted key condition like so:
Then, as a separate key, add in your conditions for access to the product. So if you want to allow access to the variant with a sign in, that will look like this:
The result of this is that all matching variants will automatically be unlocked if the product is NOT tagged with "Snowboard". In other words, the variant lock will only apply to products tagged with "Snowboard".







How to create customer liquid key conditions in Locksmith
Locksmith allows you to create a custom key conditions that use Liquid to determine whether or not the current visitor has access. This gives you a few more options than what comes with Locksmith's out-of-the-box key conditions.
Before continuing on, you may want to check out Shopify's Liquid reference, as that will give you a good idea of the kinds of things you can use when creating Liquid key conditions. Keep in mind that while Liquid key conditions can add more versatility, they are still limited to the scope of what's already available inside of Shopify's Liquid engine for the Online Store channel.
To create a Liquid key condition, start by selecting it from the key condition list. You'll be presented with the key condition area for Liquid key conditions:
This is where you'll write the primary condition, using Liquid. The condition simply needs to evaluate to true or false.
For example, consider if you simply wrote the following:
{% iffalse%}
This would result in this particular key never opening, since it's always false. This is not necessarily advisable(it would be the equivalent of adding no keys at all), but it's a proof of concept.
So, here are some examples of useful conditions.
{% if customer.metafields.namespace.key == "matching-value" %}
{% if cart.item_count > 4 %}
{% if customer.total_spent > 5000 %}
{% if template == "collection" %}
{% if canonical_url contains "/special-product-handle" %}
{% if request.page_type == "index" %}
This is a place for you to write any code that that you may need to set up the Liquid condition. It does not need to evaluate to true or false, but it does need to use valid Liquid syntax.
Basically, you can assign to any custom variable in the prelude, and then use that variable in the condition to ultimately decide whether or not the customer qualifies to use this key.
For example, your prelude could look something like this:
So now, in the "Liquid condition", you would have access to the purchase_allowed variable, so it would simply look like this:
{% if purchase_allowed %}
So that would give you even more flexibility to write different Liquid conditions that can be used to set up your locks and keys.
Relatedly, you can also use Liquid to create Locks! More information on that here:
As always, feel free to check in with us via email at [email protected], if you have any questions about any of this!
In some cases, you may want your keys to unlock certain parts of the page - like keeping the product price or add-to-cart hidden, until a customer qualifies for one of your keys.
This sort of behavior can be achieved with some custom code, and the "manual mode" setting for the relevant locks. Click the link below to learn more.
🛠️Manual mode
{% assign purchase_allowed = true %}
{% for item in cart.items %}
{% if item.product.handle contains "members-only" %}
{% assign purchase_allowed = false %}
{% endif %}
{% endfor %}Granting access to content in your store only after the appropriate purchase has been made
Locksmith allows you to check for a purchase of a specific product and only grant access to your locked content if an applicable purchase has been made.
This key condition can only account for a customer's latest 50 orders (and in some cases only the latest 25). Learn more about this in the Limitations section.
Once you that covers the content that you want to require a purchase for, click the "+ Add key" button. In the condition selector that appears, select "if the customer has purchased...".
Locksmith will examine the customer's order history for products matching what you enter.
Important: Whether you choose to enter the SKU, title (shown above), variant ID, or product tag, they are all case sensitive!
Sets a maximum allowed purchase amount. When used, Locksmith will only grant access if the customer has not yet purchased this many units of the product
Allows to you specify how far back, in days, you would like Locksmith to check for the purchase of the specified product. E.g. you may want to only allow access for 30 days after purchase.
When ON - Cancelled orders will not fulfill the requirements for access. Default: ON.
When ON - Unfulfilled orders will not fulfill the requirements for access. Default: OFF, most merchants will want to leave it this way.
When ON - Only orders with a payment status of "Paid" will fulfill the requirements for this lock. Default: ON.
Caution: This setting often causes issues for merchants who are testing out their locks. Consider turning this setting OFF while testing, but back ON for general use.
Like all key conditions, this one can be inverted. This is useful to verify that a customer has NOT yet purchased a specific product:
On its own, the inverted "unless the customer has purchased..." key will grant access to anyone who has not purchased the product, including non-signed in customers. To require customers sign in, you'll want to combine the "unless the customer has purchased..." key with the "is signed in" key:
This key condition can only account for the 50 most recent orders for the current customer. In some cases, it can only account for the most recent 25 orders instead.
The stricter 25-order limit comes into play when a customer navigates to a URL that includes a page number, e.g. a URL with "?page=2" in it. This is because a page number in the URL limits Locksmith's ability to ask Shopify for the maximum number of orders possible (i.e. 50), leaving Locksmith to work with the default number of orders (i.e. 25).
Mechanic (also made by Lightward) has a variety of tasks that can be used for this purpose. Like Locksmith, Mechanic is also available under Lightward's Pay What Feels Good pricing policy.

