astro-turnstile v0.1.1
Astro Turnstile
THIS PACKAGE IS CURRENTLY IN DEVELOPMENT AND IS NOT YET READY FOR USE
This is an Astro integration that allows you to add a turnstile to your Astro site.
Usage
Prerequisites
Before you can use this integration, you need to have a Cloudflare account. You can sign up for a free account here.
Getting Started
First, you need to create a new site in your Cloudflare account. You can do this by following the instructions here.
Once you have created a site, you will be given a site key and a secret key. You will need this key to configure the integration.
Installation
Install the integration automatically using the Astro CLI:
pnpm astro add astro-turnstile
npx astro add astro-turnstile
yarn astro add astro-turnstile
bunx astro add astro-turnstile
Or install it manually:
- Install the required dependencies
pnpm add astro-turnstile
npm install astro-turnstile
yarn add astro-turnstile
bun add astro-turnstile
- Add the integration to your astro config
+import astroTurnstile from "astro-turnstile";
export default defineConfig({
integrations: [
+ astroTurnstile(),
],
});
Configuration
You can configure the integration by passing an object to the astroTurnstile
function. The following options are available:
siteKey
(required): Your Turnstile site key- `secretKey (required): Your Turnstile secret key - this should be kept secret
Contributing
This package is structured as a monorepo:
playground
contains code for testing the packagepackage
contains the actual package
Install dependencies using pnpm:
pnpm i --frozen-lockfile
Start the playground:
pnpm playground:dev
You can now edit files in package
. Please note that making changes to those files may require restarting the playground dev server.
Licensing
MIT Licensed. Made with ❤️ by Hunter Bertoson.