๐ฅ๏ธPortal APIs
Are you ready to take your Portal to the next level? ๐
Through integrating with the Sunflower Land API you will be able to access player data, burn and mint items!
Setup & Authorisation
Inside of your .env
point your API to the dev server.
When you run your application, you will need a custom JWT (authorisation token) that gives your portal users access to load game data and persist. For security, this JWT can only be created from the Sunflower Land Game.
Players who access your portal will provide this jwt
to you through the url parameters. For instance:
crop-boom.sunflower-land.com/?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
You can then use this jwt
to make calls to load player data and other useful APIs.
If you are testing locally, you can quickly attain a jwt
by calling the authorisePortal()
inside of portalUtils.ts
Load Player Data
To load a player's data, you can use the endpoint above where PORTAL_ID
is your portal name.
See the example below in loadPortal.ts
Mint Arcade Token
<BASE_API_URL>/portal/<PORTAL_ID>/mint
Are you looking to reward your players with an Arcade Token? These can be minted once players have completed a challenge inside of your Portal. For instance, in Crop Boom once players have finished the puzzle and reached the other side.
You must first ask approval for your Portal to mint from the core team. Each Portal will have a Daily Allowance of Arcade tokens it can reward players.
Example in claimArcadeToken.ts
Block Bucks
This endpoint will be used to use player's Block Bucks - monetise ๐ค
Coming soon...
Mint Collectible or Wearable
Do you have a custom collectible or wearable you would like to reward players with? The team would love to hear your use cases
Coming soon...
Burn SFL/Resources
Coming soon...
Last updated