User Session Transactions

Performing User Session Transactions

Apps can perform transactions as a user through an authorized user session. User sessions are created when a user completes the OAuth flow for a given HYPLAY application. The app through the final redirect step of the OAuth flow returns an accessToken that is representative of a session access token of the authorized user.

User session transactions make up the backbone of HYPLAY. With them, you can perform transactions on behalf of a user based on actions they take in your app or game. This is extremely useful because it allows you to conditionally automate transactions and actions based on a user's interactions in your app without having to prompt them to sign transactions, pay gas, and more. User sessions allow your UX to be as seamless as point and click for a user.

One brief example of this is a user interacting with a merchant in a game app. If a user clicks "buy" in your game, you can trigger a transfer on behalf of the user using their session access token to transfer from their balance to your app & mint or transfer them the purchased item.

To perform a transaction with a user session, you can use the create transaction endpoint while providing your user session's access token for the x-session-authorization header.