TreyzaHelp Center
Integrations

Setting up Cloudflare Turnstile

You create a free Turnstile widget at Cloudflare and add your store's domains; then you enter the site key and secret key it gives you into Treyza and…

Where to find it: Left menu → Integrations → Security → Cloudflare Turnstile Who it's for: Stores that want to add Cloudflare's bot recognition on top of Treyza's built-in protection. In short: You create a free Turnstile widget at Cloudflare and add your store's domains; then you enter the site key and secret key it gives you into Treyza and verify each domain once on your storefront. It takes about 10 minutes.

What does it do?

Cloudflare Turnstile is Cloudflare's free bot verification service. On top of Treyza's built-in protection, it recognizes malicious traffic with what Cloudflare learns from millions of sites. Most visitors see nothing; if Cloudflare deems it necessary, a one-click verification box appears inside the form.

  • It is free and verifications are unlimited.
  • You don't need to move your store's domain to Cloudflare or change your DNS settings.
  • If Cloudflare can't be reached, visitors are automatically verified with Treyza's built-in protection; your store doesn't lock up. Details: Bot protection: how your store is protected.

Know the order up front (this is where most people get stuck)

Turnstile only works on domains you have registered with Cloudflare in advance. Treyza, in turn, tests your keys once on a domain with Verify on storefront before using them there. On a domain that isn't verified, Treyza's built-in protection keeps running; that way a wrongly copied key or a missing domain can't lock your customers out of signing in.

The correct order:

  1. List the domains your store opens on.
  2. Open a free Cloudflare account.
  3. Create a Turnstile widget and add the domains.
  4. Copy the site key and the secret key.
  5. Enter the keys into Treyza, test them, enable the integration and save.
  6. In the window that stays open, verify each domain with Verify on storefront.
  7. Try signing in to your store in a private window.

Warning: Don't skip the Verify on storefront step. Your keys are never used on domains that aren't verified; on those domains your customers are protected only by Treyza's built-in protection.


1) List your store's domains

DomainWhere to find itAdd to the widget?
mystore.treyza.shop (the default address Treyza gives you)In the description of the Store Settings → Custom Domain tab: "Default address: …"Yes, always
mystore.com (the custom domain you connected)Store Settings → Custom Domain tab (if its status is Active)Yes, if you have a custom domain
www.mystore.com—No. When you add mystore.com, Cloudflare also covers all of its subdomains such as www.mystore.com. Treyza already redirects the www address to the main address.

Example: if your store's default address is modashop.treyza.shop and your custom domain is modashop.com, you add these two domains to the widget.

Warning: Don't add treyza.shop itself; only add your own store's address (mystore.treyza.shop). Adding treyza.shop would make your widget work on every Treyza store.


2) Open a Cloudflare account

If you already have a Cloudflare account, skip this step.

  1. Open dash.cloudflare.com/sign-up.
  2. Fill in the Email and Password fields.
  3. Press the Create Account button.
  4. Click the link in the verification email Cloudflare sends you.

The account is free.


3) Create a Turnstile widget

A "widget" is the verification record you create at Cloudflare for your store.

  1. Open the Turnstile page in the Cloudflare dashboard. Direct link: dash.cloudflare.com/?to=/:account/turnstile
  2. Press the Add widget button.
  3. Fill in the form like this:
Field (in the Cloudflare dashboard)What to enter / choose
Widget nameA name that reminds you what it is, for example "Modashop storefront". Visitors don't see this name.
Hostname managementThe domains from step 1, for example modashop.treyza.shop and modashop.com. Write them without https://, without a trailing / and without a path. The * character is not accepted.
Widget modeManaged (recommended).
Pre-clearance supportLeave it off. Don't answer Yes to "Would you like to opt for pre-clearance for this site?"; this option is only for sites whose domain is registered in your own Cloudflare account.
  1. Press the Create button.

Widget mode options:

ModeWhat it doesOur recommendation
ManagedDepending on the visitor's risk level, it either shows nothing or shows a one-click box. It never asks visitors to solve images or text.Recommended
Non-InteractiveNever asks the visitor to click anything.Possible, but you lose the option of stopping a suspicious visitor with a click.
InvisibleRuns completely in the background.Not recommended. Cloudflare requires anyone choosing this mode to reference the Turnstile Privacy Addendum in their privacy policy.

Tip: Cloudflare also has a second setup button called Set up with Spin. That route adds the localhost and 127.0.0.1 addresses to the widget automatically; they don't belong on a live store. Use Add widget; if you used Spin, delete those two addresses from the widget settings.

Is there a limit on the free plan? On the free plan you can create up to 20 widgets and add up to 10 domains to each widget. Verifications are unlimited. That's more than enough for a store.


4) Copy the keys

Once the widget is created, Cloudflare shows two keys. Copy both and keep them somewhere safe:

Name at CloudflareField in TreyzaNotes
Site Key (sitekey)Site anahtarı (Site Key)Used on your storefront; it's not secret.
Secret KeyGizli anahtar (Secret Key)Treyza's server verifies with it. Don't share it with anyone.

Tip: Both keys usually start with 0x and look alike; the secret key is longer. To avoid mixing them up, copy each one by checking which is labeled Site Key and which Secret Key at Cloudflare.


5) Enter the keys into Treyza

  1. In the Treyza panel, open Integrations from the left menu.
  2. In the Security section, click the Cloudflare Turnstile card.
  3. Fill in the fields in the window that opens. The field names currently appear in Turkish in the panel even in English; this table writes them as they appear on screen:
FieldWhat to enter
Site anahtarı (Site Key)The Site Key from Cloudflare
Gizli anahtar (Secret Key)The Secret Key from Cloudflare
Girişte kullan (use on sign-in)Leave it on: Turnstile is used for customer sign-in.
Kayıtta kullan (use on sign-up)Leave it on: Turnstile is used for new sign-ups.
Şifre sıfırlamada kullan (use on password reset)Leave it on: Turnstile is used for password reset requests.
Formlarda kullan (use on forms)Leave it on: Turnstile is used on forms that have bot protection on.
  1. Press the Test Connection button and read the result (the message appears in Turkish):
ResultOn screenMeaning
Success"Gizli anahtar doğrulandı. Site anahtarını ve alan adlarını "Vitrinde doğrula" ile sınayın.""The secret key is verified. Test the site key and domains with Verify on storefront." Cloudflare recognized your secret key. The site key and domains can't be tested from the server, so you verify them on the storefront in step 6.
Error"Gizli anahtar geçersiz. Sağlayıcı panelinden kopyaladığınız gizli anahtarı kontrol edin.""The secret key is invalid. Check the secret key you copied from the provider's dashboard." The secret key is wrong, incomplete or swapped with the site key. Copy it again from Cloudflare and paste it.
Key missing"Site anahtarı ve gizli anahtar girilmeli.""The site key and the secret key must be entered." One of the fields is empty. Enter both keys and try again.
Cloudflare unreachable"Sağlayıcıya şu an ulaşılamıyor. Biraz sonra tekrar deneyin.""The provider can't be reached right now. Try again a little later." A temporary problem; try again in a few minutes.
  1. Turn on the Enable Integration switch.
  2. Press the Save button. The window stays open and the Domain verification list appears together with the text "Saved. Now verify your domains on the storefront."

Enabling first is safe: Turnstile is used only on verified domains; on domains that aren't verified, Treyza's built-in protection keeps running.

An action you turn off (for example Formlarda kullan) stays protected by Treyza's built-in protection instead of Turnstile; no action is left unprotected. Form file uploads are always verified with the built-in protection.

Warning: Only one provider can be active in the Security category at a time. When you enable Turnstile, Google reCAPTCHA is turned off automatically if it was on.

Tip: Your keys are stored encrypted; the secret key is never sent to the storefront, and after saving it is never shown in clear text in the panel either. When you open the window again, the Gizli anahtar (Secret Key) field is empty and only its last four characters are shown under it (e.g. "Saved key: ••••1234"). If you don't want to change the key, leave the field empty: Save keeps the saved key, and Test Connection tests with the saved key.


6) Verify your domains on the storefront

The keys you saved don't take effect right away. In the window you see this description: "Keys take effect on a domain only after being verified once on your storefront; until then your customers are protected by Treyza's built-in protection."

  1. Look at the Domain verification list in the window that stayed open after saving; it lists all of your store's domains. Next to the heading you see the provider's name and the integration's status (Active or Inactive). (The same list also appears on the Treyza Bot Protection card in the Integrations → Security section.) If the keys haven't been saved yet or the window has unsaved changes, you see "Save the keys first to verify your domains." instead of the list; press Save first.
  2. Press the Verify on storefront button next to a domain. Your store's sign-in page on that domain opens in a new tab. You don't need to sign in.
  3. If Cloudflare's verification box appears on the page, tick it. Within a few seconds a result banner appears on the page: "Bot protection is verified on this domain. You can go back to the panel and refresh."
  4. Go back to the panel tab; the list in the window refreshes by itself. Repeat steps 2–3 for the other domains in the list.
  5. When you're done, close the window with Close and refresh the page. The domains' statuses appear in the list on the Treyza Bot Protection card; the domains you verified show Verified.

Each domain in the list shows one of these statuses:

StatusMeaning
VerifiedThe keys were tested on this domain; if the integration is enabled, Turnstile is used on this domain.
Not verified — Treyza built-in protection is used on this domainThis domain isn't verified yet; customers are protected by the built-in protection.
Temporarily on built-in protection (30 min)Turnstile failed repeatedly on this domain, so Treyza moved the domain to the built-in protection for 30 minutes (see "Troubleshooting" below).

If no domain is verified yet, the list says "The keys haven't been verified on any domain yet." If the integration is Active, this note is shown as a warning; if it's Inactive, as an information note.

If verification fails, the banner says "Verification failed:" followed by the reason:

Reason on the bannerWhat to do
the secret key may not match this site keyCopy the Secret Key from Cloudflare again, enter it into Treyza, press Save and open Verify on storefront again.
this domain isn't registered in the provider's dashboardAdd the domain to your widget at Cloudflare (Settings → Hostname Management → Add Hostnames), wait a few minutes and verify again.
the provider can't be reached right nowCloudflare has a temporary problem; try again a little later.
the verification link expired, open it again from the panelThe verification link is valid for 30 minutes. Press Verify on storefront in the panel again.

Warning: When the Site anahtarı (Site Key) or Gizli anahtar (Secret Key) changes, all verifications are reset and the domains go back to Not verified. After changing a key, verify every domain again. Changing switches such as Girişte kullan doesn't reset verification.

Tip: If you don't verify a domain, the built-in protection keeps running there. For example, if you only verify your custom domain, visitors coming from mystore.treyza.shop are protected by the built-in protection.


7) Check that it works

  1. Open a private window in your browser (Ctrl + Shift + N in Chrome). That way your open panel session doesn't affect the test.
  2. On a verified domain, open your store's sign-in page, for example https://modashop.treyza.shop/login.
  3. Most of the time you see nothing; Turnstile runs in the background. If Cloudflare deems it necessary, a one-click box appears in the form.
  4. Sign in with a customer account. The sign-in should succeed.
  5. In the Treyza panel, on the Integrations → Security → Treyza Bot Protection card, the Verification method should be Cloudflare Turnstile and the Passed count under Last 7 days should go up.
  6. If you like, open your widget on Cloudflare's Turnstile page: within a few minutes you'll see the verification counts (e.g. Challenges issued, Valid tokens).

Tip: The theme editor preview doesn't draw the verification box; it shows "Bot verification appears here (off in preview)" instead. Always test on your real store address.


Troubleshooting

For errors during verification, first check the "Reason on the banner" table in step 6. For problems on the customer's side, Cloudflare's error code appears in the browser's developer console (the F12 key); the first three digits of the code tell you the kind of problem.

SymptomPossible causeFix
Test Connection: "Gizli anahtar geçersiz…"The secret key was copied wrongly or incompletely, has a leading or trailing space, or was swapped with the site key.Copy the Secret Key from Cloudflare again and paste it.
Under the field: "Site anahtarını Cloudflare panelinden boşluk ve tırnak olmadan yapıştırın (gizli anahtarla karıştırmayın)." or "Gizli anahtarı Cloudflare panelinden boşluk ve tırnak olmadan yapıştırın (site anahtarıyla karıştırmayın)." (paste the key without spaces or quotes; don't mix it up with the other key)The pasted value doesn't match the key format: it has a leading or trailing space or quote, or the two keys were swapped.Copy the key from Cloudflare again and paste it into the right field.
Save: "The site key and the secret key can't be the same; copy each one separately from the provider's dashboard."The same key was pasted into both fields.Copy the Site Key and the Secret Key from Cloudflare separately.
Save: "Documented test keys can't be used on a live store; copy your real keys from the provider's dashboard."One of Cloudflare's public test keys was entered.Enter your own widget's keys.
On the Verify on storefront page the box never appears; the console shows 110100, 110110 or 400020The site key was copied wrongly or the widget was deleted.Copy the Site Key from Cloudflare again and paste it into the Site anahtarı (Site Key) field; if you deleted the widget, create a new one and enter both keys. Then verify again.
The console shows 400070The widget is disabled at Cloudflare.Check the widget's status in the Cloudflare dashboard.
The panel shows "Cloudflare Turnstile rejected the secret key…"You rotated the secret key at Cloudflare or deleted the widget.Enter the new secret key into Treyza and verify the domains again (see "Rotating the secret key" below).
The panel shows "Cloudflare Turnstile can't load on {host}; this domain was moved to Treyza's built-in protection for 30 minutes. Check the domain list in the provider's dashboard."On a verified domain, Turnstile failed repeatedly for many visitors. The most common reason is that the domain was removed from the widget at Cloudflare (the console shows 110200).Check the widget's Hostname Management list at Cloudflare and add the missing domain. After 30 minutes Treyza tries Turnstile on that domain again.
The panel shows "Cloudflare Turnstile can't be reached right now…"A temporary outage at Cloudflare.You don't need to do anything; meanwhile visitors are verified with the built-in protection.
Some customers see "Security verification couldn't load…"; the console shows 200500An ad blocker or the network is blocking challenges.cloudflare.com.The customer should turn off the blocker on your store and press Try again. If it happens often, turn off the switch for that action (e.g. Girişte kullan).
The console shows a code starting with 300 or 600Cloudflare judged the visitor to be a bot, or the verification couldn't complete in the browser.The customer should refresh the page and try again, update the browser, turn off extensions and VPN, or try another browser.
The console shows 110600 or 200100The visitor's device clock is wrong or there's a problem with the browser cache.The customer should set the device clock to automatic and refresh the page.

Warning: Don't remove a verified domain from your widget at Cloudflare. If you do, customers on that domain see "Security verification couldn't load…" until Treyza moves the domain to the built-in protection.


Rotating the secret key

Rotate the secret key if you suspect it has fallen into someone else's hands.

  1. Open the Turnstile page at Cloudflare and select your widget.
  2. Choose Settings → Rotate Secret Key.
  3. Copy the new secret key.
  4. In Treyza, open Integrations → Security → the Cloudflare Turnstile card.
  5. The Gizli anahtar (Secret Key) field is empty; the last four characters of the old key are shown under it (e.g. "Saved key: ••••1234"). Paste the new key into this empty field.
  6. Check it with Test Connection and press Save. After saving, the Saved key line shows the last four characters of the new key.
  7. Because the secret key changed, the domain verifications are reset: run Verify on storefront again for every domain in the list in the window that stays open, then press Close. Meanwhile your customers are protected by the built-in protection.

The site key doesn't change; you only update the secret key.

Warning: This can't be undone. After rotation, the old secret key keeps working for only 2 more hours; enter the new key into Treyza within that time. If you don't, visitors start being verified with the built-in protection and the panel shows the "rejected the secret key" warning.


Frequently asked questions

Is Turnstile paid? No. Turnstile is free and verifications are unlimited. The free plan allows up to 20 widgets and up to 10 domains per widget.

My domain isn't on Cloudflare. Is that a problem? No. Turnstile works on any site; you don't need to move your domain to Cloudflare or change DNS settings.

I saved the keys, but my customers are still verified with the built-in protection. Turnstile takes effect on a domain only when two conditions are both met: the domain has been verified with Verify on storefront, and the Enable Integration switch is on. Verify every domain marked Not verified in the Domain verification list and check that the integration is enabled (steps 5 and 6).

Can I use Cloudflare's test keys? No. Cloudflare's public test keys let every visitor through, bots included; the protection would only be for show, so Treyza doesn't accept these keys. If you enter them, Save shows "Documented test keys can't be used on a live store; copy your real keys from the provider's dashboard." Use your own widget's keys.

I have several stores. Can I use the same widget? You can (you add every store's domain to the same widget and enter the same keys in each store). Still, we recommend a separate widget per store: Cloudflare's statistics are split store by store, and rotating one store's key doesn't affect the others.

I connected a new custom domain. First add the new domain to your widget at Cloudflare (Settings → Hostname Management → Add Hostnames), then press Verify on storefront for that domain in the Domain verification list in Treyza. Until you verify it, the built-in protection runs on that domain.

I see a "Fix with Spin" notice in the Cloudflare dashboard. Cloudflare shows this notice when it sees no verified request for the widget. It disappears once you have verified your domains and the first sign-ins happen on your storefront. If it persists, check that the Enable Integration switch is on, the domains show Verified, and that you entered this widget's keys into Treyza.

Which language does the verification box use? The box is shown in whatever language your storefront was opened in.

What happens if I turn Turnstile off? When you turn off the Enable Integration switch and press Save, every action goes back to Treyza's built-in protection; you can close the window with Close. Your keys are not deleted.

Do I need to do anything for data protection (KVKK)? Yes. Turnstile sends the visitor's IP address, browser information (User-Agent) and technical signals about their connection (the TLS fingerprint) to Cloudflare for bot detection; Cloudflare is a company based abroad. Cloudflare states that it collects these signals not to identify or target anyone but only to detect and block bots, and that it doesn't use them for advertising. You need to describe this processing in your privacy notice; for suggested wording and a note on transfers abroad, see the Legal Pages (Agreements) page.


Was this page helpful?

On this page