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

Viewed 138

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.

2 Answers

The version 14 of the facebook-nodejs-business-sdk module is out now. To install the latest version of facebook-nodejs-business-sdk you can run in the terminal.

npm install facebook-nodejs-business-sdk@latest

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