broadcasts.update rejects a single replyTo address (type is string[] only)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- api
Research direction
The narrow type lives in src/broadcasts/interfaces/update-broadcast.interface.ts, where replyTo is declared as string[]. Compare it with the create-broadcast options interface, which already uses string | string[]. Change the update type to match, then run the TypeScript type check to confirm a single string is accepted. Done when passing one address to broadcasts.update typechecks and the existing array form still works.
Written by the indexing model from the issue text.
Description
Describe the Bug
resend.broadcasts.update() only accepts replyTo as string[], so passing a single address fails to typecheck:
await resend.broadcasts.update(id, { replyTo: '[email protected]' });
// Type 'string' is not assignable to type 'string[]'
broadcasts.create() (and emails/templates) type replyTo as string | string[], and the API docs describe reply_to the same way for creating and updating a broadcast. The SDK already sends the value through unchanged, so it's only the type in UpdateBroadcastOptions that's narrower.
Link to the code that reproduces this issue
https://github.com/resend/resend-node/blob/main/src/broadcasts/interfaces/update-broadcast.interface.ts (replyTo?: string[];), compared with src/broadcasts/interfaces/create-broadcast-options.interface.ts (replyTo?: string | string[];)
To Reproduce
- In a TypeScript project, call
resend.broadcasts.update('<id>', { replyTo: '[email protected]' }). - Run
tsc.
Expected Behavior
A single address is accepted on update, the same as on create: replyTo?: string | string[].
What's your node version? (if relevant)
Not relevant (type-only).
- Dominant language
- TypeScript
- Stars
- 986
- Forks
- 101
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 26
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from resend/resend-node
-
Dependency DashboardOpen
Difficulty 4/5 3-5 days Newbie friendliness 10/100
resend/resend-node#3 ·
Maintainers usually reply within 1 day
All issues in resend/resend-node
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
siyuan-note/siyuan#21692 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GetStream/stream-chat-react#3467 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cloudflare/cloudflare-typescript#2821 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vercel-labs/ui#1139 ·
Maintainers usually reply within 1 day