# ngx-facebook-kit

> Use Facebook Account Kit with Angular5~ (https://developers.facebook.com/docs/accountkit/webjs)

Latest version **0.0.1** (published 2018-04-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-facebook-kit
pnpm add ngx-facebook-kit
yarn add ngx-facebook-kit
bun add ngx-facebook-kit
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2018-04-04 |
| First published | 2018-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 72.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | TeamCanCode |
| Maintainers | teamcc |
| Keywords | Facebook Account Kit, Facebook Kit, Angular 4, Angular 5, Team Can Code, ngx-facebook-kit, ngxfacebookkit, ngx facebook kit |

## Links

- npm: https://www.npmjs.com/package/ngx-facebook-kit
- Repository: https://github.com/teamcancode/ngx-facebook-kit
- Issues: https://github.com/teamcancode/ngx-facebook-kit/issues
- npm.io page: https://npm.io/package/ngx-facebook-kit

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.7.1

## Recent versions

- 0.0.1 (latest) — 2018-04-04
- 0.0.0 — 2018-04-04

## README

# Ngx Facebook Account Kit

This module is used for [Angular 5](https://angular.io/).  
This module help you to use [Facebook Account Kit](https://developers.facebook.com/docs/accountkit/webjs) as service.  

How to use:
-------------
### Installation:
```html
npm install ngx-facebook-kit
```
    
### Import service:
Edit in `src/app/app.module.ts`:
```typescript
//...
import { NgxFacebookKitModule, NgxFacebookKitService } from 'ngx-facebook-kit';

const facebookKitLanguage = environment.facebookKit.language;

const facebookKitConfigs = {
  appId: '<appId>',
  state: '<state>',
  version: '<version>',
  fbAppEventsEnabled: '<fbAppEventsEnabled>',
  debug: '<debug>',
  redirect: '<redirect>',
  display: '<display>'
};

@NgModule({
  //...
  imports: [
    //...
    NgxFacebookKitModule,
  ],
  bootstrap: [AppComponent]
})
export class AppModule {

  constructor(ngxFcebookKitService: NgxFacebookKitService) {
    ngxFcebookKitService.init(facebookKitConfigs, facebookKitLanguage);
  }

}
```

And call in component:
```typescript
constructor(private _ngxFacebookKitService: NgxFacebookKitService) {
}
```

### Login using phone
```html
<!-- Using directive -->
<button [ngxLoginFacebookKitPhone]="{countryCode: '+84', phoneNumber: '0909999999'}"
		(successEvent)="loginSuccess($event)"
		(errorEvent)="loginError($event)">
```

```typescript
//Using controller
login() {
    this._ngxFacebookKitService
        .loginPhone('+84', '0909999999')
        .subscribe((response) => {}, (error) => {});
}
```

### Login using email
```html
<!-- Using directive -->
<button [ngxLoginFacebookKitEmail]="'teamcancode@localhost.com'"
		(successEvent)="loginSuccess($event)"
		(errorEvent)="loginError($event)">
```

```typescript
//Using controller
login() {
    this._ngxFacebookKitService
        .loginEmail('teamcancode@localhost.com')
        .subscribe((response) => {}, (error) => {});
}
```

---
_Source: https://npm.io/package/ngx-facebook-kit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
