Skip to content

Added monetization functions - #3

Open
mrmegarik wants to merge 4 commits into
wvdsh:mainfrom
mrmegarik:monetization
Open

Added monetization functions#3
mrmegarik wants to merge 4 commits into
wvdsh:mainfrom
mrmegarik:monetization

Conversation

@mrmegarik

@mrmegarik mrmegarik commented Jul 7, 2026

Copy link
Copy Markdown

Added two core monetization functions, updated example and documentation, tested on a real live game:
Wavedash.isEntitled("entitlement-id"); > wavedash.is_entitled_async("entitlement-id")
Wavedash.triggerPaywall("entitlement-id"); > wavedash.trigger_paywall_async("entitlement-id")

Closes #2

@The64thRealm The64thRealm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We're still missing the getEntitlements function, but I can add that in a separate pr if you'd like.

Comment on lines +130 to +157
- name: is_entitled_async
type: function
desc: |
Checks whether the player owns the given paid content for this game. This is a UX hint, not a security check.
parameters:
- name: content_identifier
type: string
returns:
- name: response
type: function
desc: |
Returns true if the player owns the content.
(Note: Only if called from within a coroutine)


- name: trigger_paywall_async
type: function
desc: |
Triggers the Wavedash-rendered paywall flow for the given content and returns whether the purchase was completed. Resolves immediately with true if the player already owns it.
parameters:
- name: content_identifier
type: string
returns:
- name: response
type: function
desc: |
Returns true if the player owns the content after the flow completes.
(Note: Only if called from within a coroutine)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These are indented by 3 spaces, which causes this file to fail to parse and prevents auto-complete from working

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

change the indent to be 2 spaces

Comment on lines +531 to +537
/**
* Checks whether the player owns the given paid content for this game.
* @name is_entitled_async
* @string content_identifier
* @return response Returns true if the player owns the content. (Note:
* Only if called from within a coroutine)
*/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit but other async functions have
This is an asynchronous function. The result will be delivered as an event with id 'requestFullscreen' or as a return value if the function is called from a coroutine.
in their doc comment, can you add it for consistency?

Comment on lines +547 to +555
/**
* Triggers the Wavedash-rendered paywall flow for the given content.
* Resolves immediately with true if the player already owns it; otherwise
* opens the paywall and resolves with whether the purchase was completed.
* @name trigger_paywall_async
* @string content_identifier
* @return response Returns true if the player owns the content after the
* flow completes. (Note: Only if called from within a coroutine)
*/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment on lines +553 to +554
* @return response Returns true if the player owns the content after the
* flow completes. (Note: Only if called from within a coroutine)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This isn't true, it returns a response, you have to check entitled.success and entitled.data to make sure that they are entitled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing monetization functionality

2 participants