facebook-sdk-promise

    1.2.2 • Public • Published

    facebook-sdk-promise

    Load Facebook's SDK and return a Promise. If it's already loading it won't try to load it again.

    Install

    npm i --save facebook-sdk-promise

    Usage

    import loadFBSDK from 'facebook-sdk-promise';
    loadFBSDK().then(FB => {
        console.log('Facebook SDK has loaded!', FB);
    })

    Enable or disable the internal logging

    import loadFBSDK from 'facebook-sdk-promise';
    // it starts "off"
    loadFBSDK.logging.on();
    // [FB API] Facebook SDK script not found, loading now. Add this in the document to have the API available sooner: <script src="//connect.facebook.net/en_US/sdk.js" async></script>
    // [FB API] Waiting to be ready
    // [FB API] Ready

    Build

    The project is in ES6 but transformed into ES5 with rollup-babel-lib-bundler. To do that, run:

    npm run build

    Keywords

    none

    Install

    npm i facebook-sdk-promise

    DownloadsWeekly Downloads

    30

    Version

    1.2.2

    License

    MIT

    Unpacked Size

    4.67 kB

    Total Files

    5

    Last publish

    Collaborators

    • fregante