Skip to content

Commit 67fa7b6

Browse files
committed
fix(meta-ads): use Authorization header for getUserInfo and add maximum date preset to docs
- Pass access token via Authorization header instead of URL query param in getUserInfo, matching all other providers - Add missing 'maximum' date preset to tool param description and docs
1 parent e5fe85c commit 67fa7b6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

apps/docs/content/docs/en/tools/meta_ads.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Get performance insights and metrics for Meta Ads campaigns, ad sets, or ads
142142
| `level` | string | Yes | Aggregation level for insights \(account, campaign, adset, ad\) |
143143
| `campaignId` | string | No | Filter insights by campaign ID |
144144
| `adSetId` | string | No | Filter insights by ad set ID |
145-
| `datePreset` | string | No | Predefined date range \(today, yesterday, last_7d, last_14d, last_28d, last_30d, last_90d, this_month, last_month\) |
145+
| `datePreset` | string | No | Predefined date range \(today, yesterday, last_7d, last_14d, last_28d, last_30d, last_90d, maximum, this_month, last_month\) |
146146
| `startDate` | string | No | Custom start date in YYYY-MM-DD format |
147147
| `endDate` | string | No | Custom end date in YYYY-MM-DD format |
148148
| `limit` | number | No | Maximum number of insight rows to return |

apps/sim/lib/auth/auth.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2436,7 +2436,10 @@ export const auth = betterAuth({
24362436
logger.info('Fetching Meta user profile')
24372437

24382438
const response = await fetch(
2439-
`https://graph.facebook.com/v24.0/me?fields=id,name,email&access_token=${tokens.accessToken}`
2439+
'https://graph.facebook.com/v24.0/me?fields=id,name,email',
2440+
{
2441+
headers: { Authorization: `Bearer ${tokens.accessToken}` },
2442+
}
24402443
)
24412444

24422445
if (!response.ok) {

apps/sim/tools/meta_ads/get_insights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const metaAdsGetInsightsTool: ToolConfig<
5252
required: false,
5353
visibility: 'user-or-llm',
5454
description:
55-
'Predefined date range (today, yesterday, last_7d, last_14d, last_28d, last_30d, last_90d, this_month, last_month)',
55+
'Predefined date range (today, yesterday, last_7d, last_14d, last_28d, last_30d, last_90d, maximum, this_month, last_month)',
5656
},
5757
startDate: {
5858
type: 'string',

0 commit comments

Comments
 (0)