less than a minute read • Updated 6 days ago
Use the admin tool to sign products with HMAC
How to use the admin to manually sign product links and forms with HMAC.
The Foxy admin builds product links and forms for you and signs them automatically. This is useful for static sites, one-off forms, or any case where you want signed links without implementing a signing library.
Before you start
Enable HMAC product validation for your store first. Links and forms are only signed once that setting is on. See Enable HMAC product validation.
Steps
The output is signed, so nothing further is needed.
Notes
If your store already has live add to cart links and forms, sign those before enabling validation. Validation is all or nothing, so turning it on breaks any unsigned link still on your site.
Any change to a signed product's values, including price, breaks the signature. Rebuild the link in the builder whenever a product changes.
Signing depends on your store secret, at Settings > General under Store secrets. Changing that secret invalidates every signature you've already generated, so you'd need to rebuild all your links and forms.
For more than a handful of products, sign programmatically instead. The Foxy API has an
encodelink relationship that accepts an HTML snippet and returns a signed version. See the API cheat sheet.If you control your site's domain, Foxy's Cloudflare Worker signs links and forms at the edge, so your page source stays unsigned.