Code Monkey home page Code Monkey logo

cloudflare_turnstile's Introduction

Flutter Cloudflare Turnstile Pub

Cloudflare turnstile is a free CAPTCHAs Alternative, Turnstile delivers frustration-free, CAPTCHA-free web experiences to website visitors - with just a simple snippet of free code. Moreover, Turnstile stops abuse and confirms visitors are real without the data privacy concerns or awful user experience of CAPTCHAs.

Preview

⚠️ NOTE

This package is unofficial and not endorsed by Cloudflare. Use it at your own discretion.

Installation

flutter pub add cloudflare_turnstile

Example

Here`s a quick example that show how to add Cloudflare Turnstile widget to your flutter app

import 'package:flutter/material.dart';
import 'package:cloudflare_turnstile/cloudflare_turnstile.dart';

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: CloudFlareTurnstile(
          siteKey: '0x0000000000000000000000', //Change with your site key
          baseUrl: 'http://localhost/',
          onTokenRecived: (token) {
            print(token);
          },
        ),
      ),
    );
  }
}

For Android and iOS platforms you need to provide the baseUrl parameter with the actual URL of your Turnstile Widget Domans list. baseUrl is must be a same as list of domains when creating a Widget.

Configure Turnstile Widget

final TurnstileOptions options = const TurnstileOptions(
  mode: TurnstileMode.managed,
  size: TurnstileSize.normal,
  theme: TurnstileTheme.light,
  language: 'ar',
  retryAutomatically: false,
  refreshTimeout: TurnstileRefreshTimeout.manual,
);

//...

CloudflareTurnstile(
  sitekey: '0x0000000000000000000000',
  options: options,
);

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

cloudflare_turnstile's People

Contributors

nika0000 avatar

Stargazers

Kreazy avatar  avatar Rafael  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.