Skip to content

feat(domains): add forge activation methods - #1193

Merged
felipefreitag merged 6 commits into
canaryfrom
feat/domains-forge
Nov 18, 2026
Merged

felipefreitag merged 6 commits into
canaryfrom
feat/domains-forge

Conversation

@lucasfcosta

@lucasfcosta lucasfcosta commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Forge activation to domains: a forge.enable subresource call plus a Forge scope on the classic verify, matching the public API shape.

  • resend.domains.forge.enable({ id, customReturnPath? }) -> POST /domains/:id/forge with { custom_return_path }. Same name and validation as customReturnPath on domains.create. Activates Forge on the domain and returns the full domain response (same shape as GET /domains/:id). When customReturnPath is omitted, the API picks a subdomain that is free in the domain's DNS. The return path is set once and cannot be changed afterwards. Idempotent on the API side: enabling an already-migrated domain returns its current state.
  • resend.domains.verify(id, { scope: ['forge'] }) -> POST /domains/:id/verify. The optional scope (only value 'forge') re-checks just the Forge record, so the records that are already verified are not re-proven. Returns { object: 'domain', id }. Without scope, the request is byte-identical to before.
  • domains.update is unchanged: there is no Forge field on PATCH /domains/:id.

The domain response types are unchanged: the API carries Forge state in the records array, so callers poll the Forge record status after adding DNS.

Validation

Unit tests cover the forge enable (URL, method, snake_case body mapping, the empty-body enable), the scoped verify body, request options in the second argument both alone and mixed with scope, and the per-request options coverage spec. pnpm lint, pnpm typecheck, pnpm test (798 passing) and pnpm build pass.

Notes for reviewers

  • verify keeps its two-argument shape: VerifyDomainsOptions extends RequestOptions, so scope, headers, and signal all ride in the second argument and the implementation destructures them apart (the same merged-options shape as fetch). Every existing call compiles and behaves unchanged, and nothing is deprecated.

Summary by cubic

Adds Forge activation to domains: a forge subresource and a Forge scope on the classic verify. Bumps the package to 6.39.0.

  • resend.domains.forge.enable({ id, customReturnPath? }) activates Forge via POST /domains/:id/forge and returns the full domain; re-enabling an already-activated domain is idempotent. When customReturnPath is omitted, the API picks a free subdomain.
  • resend.domains.verify(id, { scope: ['forge'] }) re-checks only the Forge record via POST /domains/:id/verify and returns { object: 'domain', id }. VerifyDomainsOptions extends RequestOptions, so headers and signal ride in the same second argument alongside scope; existing callers passing request options are unaffected.
  • domains.update is unchanged; there is no Forge field on PATCH /domains/:id.

Domain response types are unchanged; callers track Forge state by polling the Forge record status after adding DNS.

Written for commit 33395fe. Summary will update on new commits.

View guided diff

Part of DEV-2471.

@pkg-pr-new

pkg-pr-new Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/resend@1193

commit: 33395fe

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 13 files

Confidence score: 4/5

  • src/domains/forge/forge.ts operations require an API key with full_access; callers using sending_access may be denied. Confirm the required permission is clear to production callers.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/domains/forge/forge.ts">

<violation number="1" location="src/domains/forge/forge.ts:26">
P2: Custom agent: **API Key Permission Check SDK Methods**

These Forge operations act on domain resources, so production callers need an API key with `full_access`; `sending_access` is limited to sending. Please confirm the existing production keys have the required permission before rollout.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread src/domains/forge/forge.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

@lucasfcosta
lucasfcosta marked this pull request as ready for review November 11, 2026 21:24
@lucasfcosta
lucasfcosta requested a review from a team as a code owner November 11, 2026 21:24
@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods and forge_status feat(domains): add forge activation methods Nov 11, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 5 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 5 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods feat(domains): add forge activation methods and forge_status Nov 11, 2026
@github-actions github-actions Bot added the linear-synced PR has been synced to Linear label Nov 12, 2026
@lucasfcosta lucasfcosta changed the title feat(domains): add forge activation methods and forge_status feat(domains): add forge activation methods Nov 12, 2026
Matches the reshaped API: domains.forge keeps only enable (returnPath
optional), domains.verify gains an optional scope of ['forge'] that
re-checks only the Forge record, and domains.update gains
forgeReturnPath to move the Forge return path.

Co-Authored-By: Claude Fable 5 <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 10 files (changes from recent commits).

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

Comment thread src/domains/domains.ts Resolved
Existing callers pass headers or an abort signal as verify's second
argument. The scoped options object stays the documented form, and the
legacy form is detected at runtime and still applied.

Co-Authored-By: Claude Fable 5 <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

View guided diff | Re-trigger cubic

…argument

VerifyDomainsOptions now extends RequestOptions, so scope, headers, and
signal all ride in verify's second argument and the implementation is a
single destructure. Replaces the deprecated overload and the runtime
key detection from the previous commit; every existing call keeps
working unchanged. Also drops the forgeReturnPath doc comment.

Co-Authored-By: Claude Fable 5 <[email protected]>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 5 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

@vieiralucas

Copy link
Copy Markdown
Member

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@vieiralucas I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 6 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.

View guided diff | Re-trigger cubic

@klotty klotty left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Adds the Forge enable subresource and an optional Forge scope to domains.verify, with unit tests pinning request bodies; existing verify calls stay byte-identical and no server or policy behavior changes.

View guided diff | Re-trigger cubic

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

Labels

linear-synced PR has been synced to Linear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants