Quickstart
Need somewhere to start? You're in the right place!
If you've ever implemented a "Login with Facebook/Twitter/Discord/Etc" system into an app or game before, you'll be right at home integrating HYPLAY, but if not this guide will get you up and running in about 10 minutes. Make sure you join the Discord server if you've got questions. Someone is usually on hand to help out!
Your Application
Full Guide: https://docs.hyplay.com/docs/app-registration
Everything on HYPLAY revolves around an Application. The first thing we're going to do is create one - but before we can get started, you need a HYPLAY user! If you haven't already signed up for HYPLAY, do so now at https://hyplay.com/auth. Copy down the access token, you'll need it to create an app.
Instructions for Unity: https://docs.hyplay.com/docs/unity-plugin
COMING SOON - Instructions for the developer home page.
You app only needs a name, and you can update that later. You should also include a redirect uri - this is typically the location your app is hosted. If you're uploading to itch.io, you'll want to use https://html-classic.itch.zone/html/
The developer backend is currently under maintenance, and will greatly improve this flow. We'll post a message on Discord and update the docs as soon as it is ready.
Logging In - OAuth Setup
Now it's time to log your players in. If you are familiar with the oauth flow, check out the Oauth URL Construction guide. If not, read on!
For this guide, we're going to use the following URL. You'll need to modify this for your application: https://hyplay.com/oauth/authorize/?appId=YOUR_APP_ID_HERE&chain=HYCHAIN_TESTNET&responseType=token&redirectUri=YOUR_REDIRECT_URI_HERE
- For
appId
replace theYOUR_APP_ID_HERE
with theid
of your created app from the previous step. - For
chain
, this is the blockchain that a user using this authorization flow is approving permissions for. In this case it's HYCHAIN's testnet - which is a testing environment. For mainnet (production environment) you can useHYCHAIN
. - For
responseType
we've used a value oftoken
- this means the redirectUri will have the access token returned in the redirect as a url fragment (#
). This is also known as an implicit auth flow. - For
redirectUri
replace theYOUR_REDIRECT_URI_HERE
with a approved redirect uri you set when creating your application. This is where a user will be redirected to once completing or cancelling the flow.
Here's where to find all the query parameters you can configure for your OAuth URL: https://docs.hyplay.com/docs/auth-url-construction#oauth-url-construction
To test this, you can just put the link you've constructed into the browser and try logging in. Once you've logged in, you will be redirected back to the provided redirectUri. In the redirected url, you'll see an access token after the fragment (#
) in the url. Your application can parse this out of the URL to retrieve it.
After you've retrieved an access token, you'll probably want to their details - id
, username
, etc. You can quickly get the this information with the get current user
endpoint: https://docs.hyplay.com/reference/getcurrentuser.
If you've got any questions, send us a message on Discord and we'll be able to help you straight away.
Updated 3 months ago