{"_id":"@databowl/ngx-facebook","_rev":"2-7f25eaeb9de8c77003cf7306180c0cdd","name":"@databowl/ngx-facebook","description":"Facebook TypeScript SDK for Angular2","dist-tags":{"latest":"2.5.0"},"versions":{"2.5.0":{"name":"@databowl/ngx-facebook","version":"2.5.0","description":"Facebook TypeScript SDK for Angular2","module":"dist/esm/index.js","typings":"dist/esm/index.d.ts","main":"dist/umd/index.js","scripts":{"prebuild":"rm -rf aot dist","build":"gulp build","postbuild":"rm -rf aot","build:dev":"npm run build && cp -r dist ../ng2-facebook-sdk-example/node_modules/ngx-facebook/","pretest":"rm -rf dist && tsc","test":"karma start karma.conf.js --single-run","pretest:watch":"npm run pretest","test:watch":"concurrently \"tsc -w\" \"karma start karma.conf.js\"","docs":"zm-docs-gen","postversion":"npm run changelog","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0","postchangelog":"git commit -am \"chore(): update changelog\"","lint":"tslint \"src/**/*.ts\"","prepublish":"npm run lint && npm run build"},"repository":{"type":"git","url":"git+https://github.com/IWantPizza/ngx-facebook.git"},"keywords":["facebook","angular2","sdk"],"author":{"name":"Zyra Media Inc."},"license":"MIT","bugs":{"url":"https://github.com/IWantPizza/ngx-facebook/issues"},"homepage":"https://github.com/IWantPizza/ngx-facebook","devDependencies":{"@angular/common":"4.1.2","@angular/compiler":"4.1.2","@angular/compiler-cli":"4.1.2","@angular/core":"4.1.2","@angular/platform-browser":"4.1.2","@angular/platform-browser-dynamic":"4.1.2","@types/fs-extra":"^2.0.0","@types/gulp":"^4.0.2","@types/jasmine":"^2.5.47","@types/node":"^7.0.12","@zyramedia/docs-gen":"^1.7.0","babel-polyfill":"^6.23.0","babel-preset-es2015":"^6.24.0","codelyzer":"^2.1.1","concurrently":"^3.4.0","conventional-changelog-cli":"^1.3.1","core-js":"^2.4.1","fs-extra":"^2.1.2","gulp":"git+https://github.com/gulpjs/gulp.git#4.0","jasmine-core":"^2.5.2","karma":"^1.5.0","karma-babel-preprocessor":"^6.0.1","karma-chrome-launcher":"^2.0.0","karma-cli":"^1.0.1","karma-jasmine":"^1.1.0","karma-jasmine-html-reporter":"^0.2.2","karma-phantomjs-launcher":"^1.0.4","karma-sauce-launcher":"^1.1.0","lodash":"^4.17.4","rxjs":"^5.5.6","systemjs":"^0.20.11","ts-node":"^3.0.2","tslint":"4.5.1","tslint-eslint-rules":"^3.5.1","typescript":"^2.3.3","zone.js":"0.8.11"},"gitHead":"f9898c830f2722795b5e5219787f454bf074b593","_id":"@databowl/ngx-facebook@2.5.0","_npmVersion":"5.6.0","_nodeVersion":"9.3.0","_npmUser":{"name":"hasan-db","email":"hasan@databowl.com"},"dist":{"integrity":"sha512-Zh1o+m+SQu6kob0Jirpmf36tHZQr5LIu7ZbLf29FctBalONq1xZxzF4XkCJ5aBUhndHX/FoeJSup0y0bpOMjGw==","shasum":"eee6ef457253c6377303cf549ed268e7f111f5d5","tarball":"https://registry.npmjs.org/@databowl/ngx-facebook/-/ngx-facebook-2.5.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDR0eDoLPPM9AyutpDxpLmFGHJkTcXOXC/1GCclbJr5/AIhALiZUMlNvJJ3Ksbgornnd+VdUT0hMYi87hMlF10lwSd9"}]},"maintainers":[{"name":"hasan-db","email":"hasan@databowl.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-facebook-2.5.0.tgz_1515761941703_0.8956121082883328"},"directories":{}}},"readme":"# ngx-facebook\n\nThis is a wrapper for the official Facebook JavaScript SDK. It makes it easier to use Facebook SDK with Angular 2+ by providing components, providers and types.\n\n<br><br>\n\n[![npm](https://img.shields.io/npm/l/express.svg)](https://www.npmjs.com/package/ngx-facebook)\n[![CircleCI](https://img.shields.io/circleci/project/github/zyra/ngx-facebook.svg)](https://circleci.com/gh/zyra/ngx-facebook)\n[![Sauce Test Status](https://saucelabs.com/buildstatus/ng2facebooksdk)](https://saucelabs.com/u/ng2facebooksdk)\n[![npm](https://img.shields.io/npm/dt/ng2-facebook-sdk.svg)](https://www.npmjs.com/package/ng2-facebook-sdk)\n[![npm](https://img.shields.io/npm/dm/ngx-facebook.svg)](https://www.npmjs.com/package/ngx-facebook)\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/ng2facebooksdk.svg)](https://saucelabs.com/u/ng2facebooksdk)\n\n<br><br>\n\n## Installation\n\n#### 1. Install via NPM:\n\n```shell\nnpm i --save ngx-facebook\n```\n\n#### 2. Add the Facebook JavaScript SDK to your index.html\n```html\n<script type=\"text/javascript\" src=\"https://connect.facebook.net/en_US/sdk.js\"></script>\n```\n\n#### 3. Import `FacebookModule` into your app's root module\n```typescript\n\nimport { FacebookModule } from 'ngx-facebook';\n\n@NgModule({\n  ...\n  imports: [\n    FacebookModule.forRoot()\n  ],\n  ...\n})\nexport class AppModule { }\n\n```\n\nIf you only want to use [FacebookService](https://zyra.github.io/ngx-facebook/facebook-service) only, without using the other components, then you can import it in your app's module instead of `FacebookModule`.\n\n#### 4. Inject `FacebookService` and call the `init` method (optional):\nThis method must be called before using [`login`](http://zyra.github.io/ngx-facebook/facebook-service/#login) or [`api`](http://zyra.github.io/ngx-facebook/facebook-service/#api) methods. It is not required for other methods/components.\n\n```typescript\nimport { FacebookService, InitParams } from 'ngx-facebook';\n\n...\n\nexport class MyComponentOrService {\n\n  constructor(private fb: FacebookService) {\n\n    let initParams: InitParams = {\n      appId: '1234566778',\n      xfbml: true,\n      version: 'v2.8'\n    };\n\n    fb.init(initParams);\n\n  }\n\n}\n```\n\n<br><br>\n\n## Documentation\nYou can view complete and detailed documentation by visiting https://zyra.github.io/ngx-facebook/.\n\n<br><br>\n\n## Example Usage\n\nYou can view our [example project here](https://zyra.github.io/ngx-facebook-example/) and/or view its [source code here](https://github.com/zyra/ngx-facebook-example/)\n\n<br><br>\n\n### Example of login with Facebook\n\n```typescript\nimport { FacebookService, LoginResponse } from 'ngx-facebook';\n\n@Component(...)\nexport class MyComponent {\n\n  constructor(private fb: FacebookService) { }\n\n  loginWithFacebook(): void {\n\n    this.fb.login()\n      .then((response: LoginResponse) => console.log(response))\n      .catch((error: any) => console.error(error));\n\n  }\n\n}\n```\n\n<br><br>\n\n### Example of sharing on Facebook\n```typescript\nimport { FacebookService, UIParams, UIResponse } from 'ngx-facebook';\n\n...\n\nshare(url: string) {\n\n  let params: UIParams = {\n    href: 'https://github.com/zyra/ngx-facebook',\n    method: 'share'\n  };\n\n  this.fb.ui(params)\n    .then((res: UIResponse) => console.log(res))\n    .catch((e: any) => console.error(e));\n\n}\n```\n\n<br><br>\n\n### Example of adding a Facebook like button\n```html\n<fb-like href=\"https://github.com/zyra/ngx-facebook\"></fb-like>\n```\n\n<br><br>\n\n### Example of playing a Facebook video\n\n#### Basic video component usage:\n```html\n<fb-video href=\"https://www.facebook.com/facebook/videos/10153231379946729/\"></fb-video>\n```\n\n#### Advanced video component usage:\n```html\n<fb-video href=\"https://www.facebook.com/facebook/videos/10153231379946729/\" (paused)=\"onVideoPaused($event)\"></fb-video>\n```\n```typescript\nimport { Component, ViewChild } from '@angular/core';\nimport { FBVideoComponent } from 'ngx-facebook';\n\n@Component(...)\nexport class MyComponent {\n\n  @ViewChild(FBVideoComponent) video: FBVideoComponent;\n\n  ngAfterViewInit() {\n    this.video.play();\n    this.video.pause();\n    this.video.getVolume();\n  }\n\n  onVideoPaused(ev: any) {\n    console.log('User paused the video');\n  }\n\n}\n```\n\n<br><br>\n## Contribution\n- **Having an issue**? or looking for support? [Open an issue](https://github.com/zyra/ngx-facebook/issues/new) and we will get you the help you need.\n- Got a **new feature or a bug fix**? Fork the repo, make your changes, and submit a pull request.\n\n## Support this project\nIf you find this project useful, please star the repo to let people know that it's reliable. Also, share it with friends and colleagues that might find this useful as well. Thank you :smile:\n","maintainers":[{"email":"dev.pmill@gmail.com","name":"pmill"},{"email":"me@tom-pryor.co.uk","name":"tpryor"},{"email":"hasan@databowl.com","name":"hasan-db"}],"time":{"modified":"2022-04-05T02:51:38.461Z","created":"2018-01-12T12:59:02.841Z","2.5.0":"2018-01-12T12:59:02.841Z"},"homepage":"https://github.com/IWantPizza/ngx-facebook","keywords":["facebook","angular2","sdk"],"repository":{"type":"git","url":"git+https://github.com/IWantPizza/ngx-facebook.git"},"author":{"name":"Zyra Media Inc."},"bugs":{"url":"https://github.com/IWantPizza/ngx-facebook/issues"},"license":"MIT","readmeFilename":"README.md"}