How to deploy canisters from frontend code to mainnet?

I have an asset canister that hosts some frontend. This frontend is able to deploy another canisters on-the-fly. This works fine on my local replica, but I don’t know how to make it work on the mainnet, because of cycles management.

The keypair I have in dfx is charged with cycles and is able to deploy canisters to the mainnet. But the frontend uses II for authorization, so there I have another keypair, which obviously doesn’t have any cycles at its disposal.

Here is the information about so-called wallet custodians - one could use them to delegate canister creation permission to another principal. But what principal exactly should I pass to this command, since II does this anonymizing thing and I don’t know what principal would I have calling the management canister.

Please help.

@kpeacock would you please take a look?

If you are using the auth-client, you can use authClient.getIdentity().getPrincipal(). That’s the principal you’ll want to authorize