facebook / facebook-nodejs-business-sdk

Node.js SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
497 stars 227 forks source link

How to have types / intellisense? #276

Open phillipmohr opened 7 months ago

phillipmohr commented 7 months ago

Which SDK version are you using?

18.0.4 with VSCode

What's the issue?

I'm currently getting started with the facebook-nodejs-business-sdk. I'm trying to retrieve one campaign by ID. However, I'm not having types/intellisense which makes it hard to consume the API as someone who doesn't have experience with it.

Steps/Sample code to reproduce the issue

This is my approach:

const campaign = await (new Campaign(campaignId)).get([
            'id',
            'name',
            'ads{adset_id,name,leadgen_forms{id,name}}',
        ]);

console.log('no intellisense for "id"', campaign.id)
console.log('no intellisense for "name"', campaign.name)

Observed Results:

Expected Results: