marsidev / react-turnstile

Cloudflare Turnstile integration for React.
https://www.npmjs.com/package/@marsidev/react-turnstile
MIT License
358 stars 21 forks source link

sitekey was not provided #39

Closed gbagush closed 11 months ago

gbagush commented 11 months ago
<Turnstile
    siteKey={process.env.SITE_KEY}
/>

i already import dotenv but its show sitekey was not provided

CanopusFalling commented 1 month ago

What was the solution to this? I'm currently stuck with either the same or a similar problem.

gbagush commented 1 month ago

What was the solution to this? I'm currently stuck with either the same or a similar problem.

I use nextjs, so the env variable must begin with NEXTPUBLIC so that it can be accessed on the client side

https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables

CanopusFalling commented 1 month ago

Ah, thanky for the reply, unfortunately that wasn't it for me (think I'm running into some strange behaviour with edge, turnstile and wrangler all fighting.)