fix(types): allow custom fields in BranchLinkControlParams #1036
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference
SDK-XXXX -- <TITLE>.
Summary
Updates the
BranchLinkControlParams
to allow custom entries.Motivation
The documentation says this is how custom data, such as
referring_user_id
should be added to deep links, but the types didn't allow for this. Ignoring the types and testing link generation showed that values were passed through successfully, so no change was needed on the code side.From my testing, all values passed here (strings, numbers, booleans, nulls) were stringified, so I went with
Record<string, string>
as the type so that users will expect strings on the other side. I also found that passing an explicitundefined
would drop the key entirely from the result, so I thought theRecord
approach was better than[custom: string]: string | undefined
, where users might expect the key to be present but with no value, or anull
when they handle the deep link.Type Of Change
Testing Instructions
cc @BranchMetrics/saas-sdk-devs for visibility.
As an aside, your CONTRIBUTING.md still points to an issue tracker, even though issues seem to have been disabled for this repo.