Link game namespaces to an AMS account
Overview
When an AMS account is created from a game namespace, the account is automatically linked to that namespace. AMS supports account linking across game namespaces to share resources such as server images, observability account and metrics, and a billing account.
To link an AMS account to a game namespace, follow these steps in the AGS Admin Portal or with the AGS CLI, in this order:
- Generate linking token from a linked game namespace.
- Link AMS account to an unlinked game namespace.
Before you follow the AGS CLI steps, install the AGS CLI and sign in with an account that has access to these features. See Install and sign in. The examples use a Bash shell.
Generate linking token from linked game namespace
- Admin Portal
- AGS CLI
- In the AccelByte Gaming Services (AGS) Admin Portal, go into the game namespace where you created your AMS account.
- On the sidebar, go to any of the components under the AMS menu (e.g., Fleet Manager).
- In the upper-right corner on the page of your selected component, you will see AMS Account:
<account name and info>. Click or your account name. The AMS Account page appears. - Click the + Generate New Linking button.
- On the New Linking Token pop-up that appears, copy the linking token.
This token is limited to a one time use and will expire after the date and time shown on this pop-up.
-
Generate a linking token from the game namespace where you created your AMS account. Replace
<YourLinkedNamespace>with that namespace.ags ams account get-link-token --namespace <YourLinkedNamespace> -
Copy the
tokenvalue from the response.noteYou can use this token only once, and it expires one hour after you generate it.
You will apply this linking token to an unlinked game namespace to link the AMS account to that namespace in the next section.
Link AMS account to an unlinked game namespace
- Admin Portal
- AGS CLI
- In the AccelByte Admin Portal, go to the unlinked game namespace.
- On the sidebar, go to AMS > Set up AMS Account.
- On the Setup AMS Account page, click Already have an AMS Account? to expand it.
- Enter (paste) your linking token into the Linking Token field and click the Link button.
- On the Link AMS Account confirmation pop-up, type in the name of your game namespace in the field and click the Link button.
Your game namespace is now linked with your AMS account.
-
Create a file named
link-token.jsonwith the linking token you copied. Replace<YourLinkingToken>with the token.{
"token": "<YourLinkingToken>"
} -
Link the AMS account to the unlinked game namespace. Replace
<YourUnlinkedNamespace>with that namespace.ags ams account link --namespace <YourUnlinkedNamespace> --json @link-token.jsonThe command fails if the namespace is already linked to an AMS account.
-
Delete
link-token.json. The token can link a namespace to your AMS account until it's used or expires.
Verify linked game namespaces
To check if a game namespace has an AMS account linked to it, follow these steps:
- Admin Portal
- AGS CLI
- In the AccelByte Admin Portal, go into the game namespace that you want to check.
- On the sidebar select AMS.
- Verify that the namespace is linked to an AMS account.
- If an account is linked to the namespace, the full functionality and user interface for AMS will be enabled under the AMS menu on the Admin Portal sidebar.
- If an account is NOT linked to this namespace, AMS will only have the Setup AMS Account option.
Get the AMS account of the game namespace that you want to check. Replace <YourGameNamespace> with that namespace.
ags ams account get --namespace <YourGameNamespace>
- If an account is linked to the namespace, the response shows the account and lists the namespace under
namespaces. - If an account is NOT linked to the namespace, the command fails with a not found error.
What's next
Now that you have set up your AMS account, refer to the Download CLI tools from the Admin Portal page to get the AMS tools you'll need for your local development environment.