Giter Site home page Giter Site logo

react-facebook-account-kit's Introduction

React Account Kit

npm

An Account Kit Component for React

Install

npm install react-facebook-account-kit

How to use

import React from 'react';
import ReactDOM from 'react-dom';
import AccountKit from 'react-facebook-account-kit';

ReactDOM.render(
    <AccountKit
      appId="your-facebook-appId" // Update this!
      version="v1.0" // Version must be in form v{major}.{minor}
      onResponse={(resp) => console.log(resp)}
      csrf={'csrf token here!'} // Required for security
      countryCode={'default country code'} // eg. +60
      phoneNumber={'default phone number'} // eg. 12345678
      emailAddress={'default email address'} // eg. [email protected]
    >
      {p => <button {...p}>Initialize Account Kit</button>}
    </AccountKit>,
  document.getElementById('app')
);

Required Props

  • csrf CSRF token as a string (Required by account kit sdk)
  • appId Facebook's app id (string)
  • version Account kit SDK version (string),
  • children Function that will return a valid react component or null,
  • onResponse Function that will handle the response for possible responses check Account Kit Documentation

Optional Props

  • loginType default is PHONE
  • debug default is false
  • disabled default is false
  • display can be popupor modal. default value is popup
  • language default is en_US
  • countryCode default country code. default value is undefined
  • phoneNumber default phone number. default value is undefined
  • emailAddress default email address. default value is undefined. loginType must be set to "EMAIL" for this to work.
  • redirect redirect URL after email confirmation. default value is undefined. loginType must be set to "EMAIL" for this to work.

Reference: https://developers.facebook.com/docs/accountkit/webjs/reference

Dev Server

npm run start

Default dev server runs at localost:8080 in browser. You can set IP and PORT in webpack.config.dev.js

Production Bundle

npm run bundle

Follow me on Twitter: @zsajjad93

react-facebook-account-kit's People

Contributors

zsajjad avatar support-fetchsky avatar joaomarceloods avatar anieri avatar

Watchers

James Cloos avatar muigai 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.