Implementing Custom Utility
Last updated
Last updated
Need to perform some additional action upon the user claiming successfully? There are a few ways you can implement this. Note that depending on your use case, you may also need to authenticate the user as well on your end. We recommend using Sign In with BitBadges for this.
The easiest and most typical approach is to just do this with preconfigured plugins. Many use cases are already implemented for you and will auto execute for you if configured. For example, the Send BitBadges Notification plugin or Assign Discord Role.
When creating rewards on the claim builder page, you can also link gated content / URLs to only be visible to users upon successfully claiming. You can add dynamic variables, but note that this does not protect against the users sharing the secret URL.
You may need additional authentication depending on your tolerance level. You can even consider this in-site URL to initially be a Sign In with BitBadges URL here with eventual redirect support to your destination URL. Authentication becomes streamlined this way.
To lookup claim state or recent claim attempts by address or other claim information, use the BitBadges API to query this data. Then, implement your logic as you see fit.
If you want to automate this process, consider using Zapier to auto-execute logic upon claim successes.
Set up a custom validation URL (during execution) or success webhook (post-success) and receive the following information (plus any custom user inputs or configured user socials you want to receive) via the payload. See the custom plugin documentation for more information. Note the passed socials are just the user identifiers and have no sensitive authentication info like access tokens.
This can either be setup through the in-site plugins as shown above, or you can custom create and potentially publish your own from scratch.