Managing Your Players
Start manging your players with your integration

Step 1: Creating a Player

In this step, with the access token that you retrieved in the previous step, you will need to pass that as the authorization header when running the CreatePlayer mutation.
Your authorization system needs to check to see if a user's account has been created yet.
  • If it hasn't, it should create a new account for them.
  • If it has, then the system should try to log them in.
The following query will create a new player for your system:
1
mutation {
2
CreatePlayer(id: "John Wick") {
3
accessToken
4
}
5
}
Copied!
Once you have created an Enjin account, it's advisable to enter the reference into your database, so you don't repeat this process unnecessarily in the future.

Step 2: Logging Your Player In

In this final step of integration, once you are have confirmed that your player has an existing account, you can log your player in by following this query:
1
query GetPlayerAccessToken {
2
AuthPlayer(id: "John Wick"){
3
accessToken
4
expiresIn
5
}
6
}
Copied!
To check if your player has linked their Enjin Wallet, you can run the following query:
1
{
2
GetPlayer(id: "John Wick") {
3
id
4
wallet {
5
ethAddress
6
}
7
linkingInfo {
8
code
9
qr
10
}
11
createdAt
12
updatedAt
13
}
14
}
Copied!
If the API request returns a valid linking code and/or linking QR link, then your player hasn't linked their wallet. If there's no linking code (i.e. displaying null), this means the wallet is linked and you can send your player into your game.
​
Last modified 1mo ago