Skip to content

docs: Add form lifecycle event hooks section to README#517

Draft
ajaysubra wants to merge 3 commits intomasterfrom
docs/form-lifecycle-hooks-readme
Draft

docs: Add form lifecycle event hooks section to README#517
ajaysubra wants to merge 3 commits intomasterfrom
docs/form-lifecycle-hooks-readme

Conversation

@ajaysubra
Copy link
Copy Markdown
Contributor

Summary

  • Adds documentation for the new registerFormLifecycleHandler / unregisterFormLifecycleHandler public API introduced in the form lifecycle hooks feature

Notes

This PR is intentionally kept separate from the feature PR (#515) so it can be merged after the feature is released and the version number is known.

🤖 Generated with Claude Code


### Monitoring Form Lifecycle Events

> ℹ️ Form lifecycle events are available in SDK version 5.x.0 and higher
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TODO: update when we know the release version.


KlaviyoSDK().registerFormLifecycleHandler { event in
switch event {
case .formShown:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

update with form id etc

Update the registerFormLifecycleHandler example to use the (event, context)
signature and show accessing context.formId and context.formName in each case.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant