Skip to content

Conversation

@nicfix
Copy link
Contributor

@nicfix nicfix commented Nov 14, 2025

Summary

  • allow Purchases.configure to accept an optional context with a workflow identifier
  • store the workflow identifier in EventsTracker and include it on emitted events
  • update API report and tests for the new configuration surface

Testing

  • npm run build
  • npm run extract-api
  • npm run test -- src/tests/behavioral-events/events-tracker.test.ts

Codex Task

@nicfix nicfix added the pr:feat label Nov 14, 2025
@nicfix nicfix requested a review from a team November 14, 2025 09:29
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

I'm just wondering if this should be a parameter for presentPaywall/purchase methods, instead of a configuration parameter... thoughts?

Copy link
Contributor

@elenaperezrioja elenaperezrioja left a comment

Choose a reason for hiding this comment

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

So this will be passed when calling _trackEvent, right? which is good, but we're already passing it in the properties of the event.

We're not passing the workflow id when a purchase is happening so that we can access it in khepri after the transaction is created, right?

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

As long as we make these APIs internal, this looks good! And also, I would consider renaming the PurchasesContext to PresentedWorkflowContext, so it's more concrete and similar to the PresentedOfferingContext that has a similar utility.

@nicfix
Copy link
Contributor Author

nicfix commented Nov 14, 2025

What about:

  @internal
  context: { presentedWorflowContext: { workflowId}}

So that in the future we can extend the context and still have an object for the presentedWorkflowContext?

@tonidero
Copy link
Contributor

What about:

  @internal
  context: { presentedWorflowContext: { workflowId}}

So that in the future we can extend the context and still have an object for the presentedWorkflowContext?

I like that!

@elenaperezrioja
Copy link
Contributor

What about:

  @internal
  context: { presentedWorflowContext: { workflowId}}

So that in the future we can extend the context and still have an object for the presentedWorkflowContext?

That's great :) I can imagine needing to pass some additional info like workflowRevision at some point

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

Makes sense! 🚢

@nicfix nicfix merged commit e0d23ec into main Nov 14, 2025
6 checks passed
@nicfix nicfix deleted the codex/add-workflowidentifier-to-sdk-configure-method branch November 14, 2025 14:54
@nicfix nicfix added pr:other and removed pr:feat labels Nov 14, 2025
This was referenced Nov 17, 2025
tonidero pushed a commit that referenced this pull request Nov 17, 2025
**This is an automatic release.**

## RevenueCat SDK
### 🐞 Bugfixes
* Fix `identifyUser` wasCreated (#654) via Toni Rico (@tonidero)

### 🔄 Other Changes
* Add workflowIdentifier to PresentedOfferingContext interface (#651)
via Elena Pérez Rioja (@elenaperezrioja)
* Add context workflow identifier support (#649) via Nicola Sacco
(@nicfix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants