Home > OS >  How to use version version 14 in facebook-nodejs-business-sdk for Facebook Business API?
How to use version version 14 in facebook-nodejs-business-sdk for Facebook Business API?

Time:06-23

This is my first question to Stackoverflow. Please let me know if I need to provide more info.

The facebook-nodejs-business-sdk is still in version 13. Is there a way to call for Facebook Business API version 14?

I tried updating to the latest version from npm installs but its only v13.

CodePudding user response:

This can be addressed by overriding the SDK API version with the following (right after you require the package):

const bizSdk = require('facebook-nodejs-business-sdk');

// Set ads api version
Object.defineProperty(bizSdk.FacebookAdsApi, 'VERSION', { get: () => 'v14.0' });
Object.defineProperty(bizSdk.FacebookAdsApi, 'SDK_VERSION', { get: () => 'v14.0.0' });```

Hope this helps the many of you in trouble with this.
  • Related