Skip to content

feat(fb_custom_audience): add accounts framework support#2363

Open
shekhar-rudder wants to merge 1 commit intodevelopfrom
int-5928-fb-audience-accounts
Open

feat(fb_custom_audience): add accounts framework support#2363
shekhar-rudder wants to merge 1 commit intodevelopfrom
int-5928-fb-audience-accounts

Conversation

@shekhar-rudder
Copy link
Member

@shekhar-rudder shekhar-rudder commented Feb 25, 2026

Summary

Adds Accounts Framework support for the Facebook Custom Audience destination as part of INT-5928.

  • New account definition (fb_custom_audience_access_token): introduces db-config.json, ui-config.json, and schema.json under accounts/ for the DESTINATION_FB_CUSTOM_AUDIENCE_ACCESS_TOKEN account type, supporting access_token authentication with accessToken as a secret field.
  • Updated db-config.json: registers supportedAccountDefinitions mapping rudderAccountId to the new account definition, and adds rudderAccountId to destConfig.defaultConfig.
  • Updated ui-config.json: adds an accountManagementInput field (rudderAccountId) in the Connection Settings group alongside the existing accessToken field for backward compatibility.
  • Updated schema.json: adds rudderAccountId as a string property and introduces a oneOf constraint ensuring exactly one of accessToken or rudderAccountId is provided — not both, not neither.
  • Updated validation tests: adds test cases covering the valid rudderAccountId-only path, the invalid both-present case, and the invalid neither-present case.

Existing accessToken field is kept intact until migration to the Accounts Framework is complete.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Facebook Custom Audience destination with access token authentication support
    • Introduced account management connection option as an alternative authentication method
    • New form fields for configuring Account Name and Access Token
  • Tests

    • Added validation tests for authentication method mutual exclusivity

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 25, 2026

Warning

Rate limit exceeded

@shekhar-rudder has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 789673c and a7515ad.

📒 Files selected for processing (8)
  • src/configurations/destinations/fb_custom_audience/accounts/fb_custom_audience_access_token/db-config.json
  • src/configurations/destinations/fb_custom_audience/accounts/fb_custom_audience_access_token/schema.json
  • src/configurations/destinations/fb_custom_audience/accounts/fb_custom_audience_access_token/ui-config.json
  • src/configurations/destinations/fb_custom_audience/db-config.json
  • src/configurations/destinations/fb_custom_audience/schema.json
  • src/configurations/destinations/fb_custom_audience/ui-config.json
  • src/schemas/account/account-db-config-schema.json
  • test/data/validation/destinations/fb_custom_audience.json
📝 Walkthrough

Walkthrough

The changes introduce a new account-based authentication method for the Facebook Custom Audience destination. A new access token account type configuration is added alongside modifications to the parent destination configuration to support selecting pre-configured accounts via rudderAccountId, enforcing mutual exclusivity between manual accessToken and managed accounts through schema constraints.

Changes

Cohort / File(s) Summary
New Account Configuration
src/configurations/destinations/fb_custom_audience/accounts/fb_custom_audience_access_token/db-config.json, schema.json, ui-config.json
Adds a new DESTINATION_FB_CUSTOM_AUDIENCE_ACCESS_TOKEN account type with database configuration, JSON schema validation (supporting templated tokens, environment variables, and direct strings), and UI form fields for account name and access token input.
Parent Destination Configuration
src/configurations/destinations/fb_custom_audience/db-config.json, schema.json, ui-config.json
Updates destination config to support rudderAccountId for account management, adds rudderAccountId property, introduces oneOf schema constraint ensuring mutual exclusivity between accessToken and rudderAccountId, and adds accountManagementInput UI field for account selection.
Validation Tests
test/data/validation/destinations/fb_custom_audience.json
Adds three test cases validating the new mutual exclusivity rules: valid config with only rudderAccountId, invalid configs with both credentials or neither credential present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 Behold! Account management blooms,
No more tokens typed in darkened rooms,
A choice between the old and new,
One path selected, validated true,
For Facebook's audiences, a cleaner view!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding Accounts Framework support to the Facebook Custom Audience destination.
Description check ✅ Passed The description provides comprehensive details on the changes, references the Linear task (INT-5928), and explains the objectives including the new account definition, schema constraints, and backward compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch int-5928-fb-audience-accounts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/configurations/destinations/fb_custom_audience/schema.json`:
- Around line 6-8: The schema field rudderAccountId currently allows an empty
string; update the JSON schema for rudderAccountId to require a non-empty value
(for example add "minLength": 1 or a non-empty pattern) so the credential oneOf
branch cannot be satisfied by "" at runtime; locate the rudderAccountId
definition in src/configurations/destinations/fb_custom_audience/schema.json and
add the non-empty constraint (minLength or pattern) to enforce a usable
credential.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3f4ad6 and 789673c.

📒 Files selected for processing (7)
  • src/configurations/destinations/fb_custom_audience/accounts/fb_custom_audience_access_token/db-config.json
  • src/configurations/destinations/fb_custom_audience/accounts/fb_custom_audience_access_token/schema.json
  • src/configurations/destinations/fb_custom_audience/accounts/fb_custom_audience_access_token/ui-config.json
  • src/configurations/destinations/fb_custom_audience/db-config.json
  • src/configurations/destinations/fb_custom_audience/schema.json
  • src/configurations/destinations/fb_custom_audience/ui-config.json
  • test/data/validation/destinations/fb_custom_audience.json

Adds Accounts Framework support for Facebook Custom Audience destination
as part of INT-5928. Introduces a new access token account definition and
updates destination configs to support rudderAccountId alongside the
existing accessToken field for a backward-compatible migration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@@ -3,6 +3,9 @@
"displayName": "Facebook Custom Audience",
"config": {
"features": ["vdm-next"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this "features": has any usage ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any references in the webapp. @arpl Can you confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants