Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom tags and handlers #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andregoncalvesdev
Copy link
Contributor

@andregoncalvesdev andregoncalvesdev commented Jan 22, 2024

SWY-1436

Integration wrapper

const topper = new TopperWebSdk({ use_assets: true });

...
topper.initialize({ bootstrapToken: 'XXX' });
topper.registerHandler(TOPPER_HANDLERS.ASSETS, fetchTopperAssets);

Topper

return {
  assets: queryConfig.useAssets ? await TopperWebSdk.resolveHandler(TOPPER_HANDLERS.ASSETS) : toData(await assetsPromise),
  quote: { ...finalQuote, isInitial: true }
};
assets.mov

@@ -18,13 +18,39 @@ class TopperWebSdk {
environment: Environments.PRODUCTION,
is_android_app: false,
is_ios_app: false,
use_assets: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

or make this an array ['assets'], default to [] and append on 116 accordingly.

@andregoncalvesdev andregoncalvesdev force-pushed the feature/add-custom-tags-handlers branch from 1c8469d to 05a5189 Compare January 22, 2024 21:28
WIDGET_CONTINUE_BUTTON_CLICKED = 'widgetContinueButtonClicked'
WIDGET_CONTINUE_BUTTON_CLICKED = 'widgetContinueButtonClicked',
// Internal
RESOLVE_HANDLER = 'resolveHandler'
Copy link
Contributor Author

@andregoncalvesdev andregoncalvesdev Jan 22, 2024

Choose a reason for hiding this comment

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

move this to another enum.

@andregoncalvesdev andregoncalvesdev force-pushed the feature/add-topper-web-sdk branch from e15b5f1 to 8462d00 Compare January 22, 2024 21:37
@andregoncalvesdev andregoncalvesdev force-pushed the feature/add-custom-tags-handlers branch from 05a5189 to 397d1dd Compare January 22, 2024 21:39
Base automatically changed from feature/add-topper-web-sdk to master January 23, 2024 15:49
@andregoncalvesdev andregoncalvesdev force-pushed the feature/add-custom-tags-handlers branch from 397d1dd to 931cf0c Compare January 26, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant