Linking a Player Wallet
Learn how to create a player identifier for your users and how to generate a linking code on their behalf.

CreatePlayer

Create a Player identity for one of the users by running this specific mutation.
mutation {
CreatePlayer(id: "playername") {
accessToken
}
}
We recommend setting the username from your app as a static identifier from your existing database, so you always know how to reference the user’s Enjin identity.
The getPlayer query will return a linking code that you can display to the user. The user will scan the linking code with the Enjin Wallet and link their wallet to your project.
{
GetPlayer(id: "playername") {
id
wallet {
ethAddress
}
linkingInfo {
code
qr
}
createdAt
updatedAt
}
}
After the user links their wallet, you can run that same exact query to return the user-linked wallet address, you can save the address to query the user wallet anytime you may need to.
Export as PDF
Copy link