broadcasts.update rejects a single replyTo address (type is string[] only)

Open Beginner friendly
#1,206 0 comments 0 reactions 0 assignees View on GitHub

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
  1. In a TypeScript project, call resend.broadcasts.update('<id>', { replyTo: '[email protected]' }).
  2. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from resend/resend-node

All issues in resend/resend-node

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.