Integration
Configure the controller
The controller needs to be configured with the additional parameters:
namespace
: The namespace of the game.slot
: The slot name associated to the torii instance.
new ControllerConnector({
url,
rpc,
profileUrl,
namespace: "dopewars",
slot: "ryomainnet",
theme,
colorMode,
policies,
});
Open the achievements page
Integrate the achievements page in your game client
You can add this following callback to a button to open the achievements page.
const { connector } = useAccount();
const handleClick = useCallback(() => {
if (!connector?.controller) {
console.error("Connector not initialized");
return;
}
connector.controller.openProfile("achievements");
}, [connector]);