> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Triggering Delegation

> How to trigger delegation for a user in Unity.

In your application, when a user is logged in, you'll want to request delegation for your application.

<Info>
  Make sure you have [configured delegated access](/docs/overview/wallets/embedded-wallets/mpc/delegated-access/configuration) in the dashboard before triggering delegation.
</Info>

## Dynamic's UI

### Auto-prompt user on sign in

If you chose to prompt the user on sign in during the [configuration step](/docs/overview/wallets/embedded-wallets/mpc/delegated-access/configuration), the user is prompted to approve delegation for your application when they next sign in.

### Trigger delegation manually

You can use the `InitDelegationProcess` method to open the delegation modal UI:

```csharp theme={"system"}
// Open the delegation modal for all eligible wallets
await DynamicSDK.Instance.Wallets.InitDelegationProcess();

// Or specify which wallets to delegate
await DynamicSDK.Instance.Wallets.InitDelegationProcess(
    walletIds: new List<string> { "wallet-id-1", "wallet-id-2" }
);
```

### Check if user should be prompted

Before prompting, you can check whether the user should see a delegation prompt:

```csharp theme={"system"}
bool shouldPrompt = await DynamicSDK.Instance.Wallets.ShouldPromptWalletDelegation();

if (shouldPrompt)
{
    await DynamicSDK.Instance.Wallets.InitDelegationProcess();
}
```

## Your own UI

You can use `DelegateKeyShares` to delegate wallets programmatically without showing any Dynamic UI:

```csharp theme={"system"}
using DynamicSDK.Core;
using System.Collections.Generic;

// Delegate all eligible wallets
await DynamicSDK.Instance.Wallets.Waas.Delegation.DelegateKeyShares();

// Or delegate specific wallets
await DynamicSDK.Instance.Wallets.Waas.Delegation.DelegateKeyShares(
    new List<DelegationWalletIdentifier>
    {
        new()
        {
            ChainName = ChainEnum.Evm,
            AccountAddress = "0x123...",
        },
        new()
        {
            ChainName = ChainEnum.Sol,
            AccountAddress = "ABC123...",
        },
    }
);
```

## Check wallet delegation status

```csharp theme={"system"}
// Check if wallet is eligible for delegation
bool eligible = DynamicSDK.Instance.Wallets.Waas.Delegation.IsWalletEligibleForDelegation(wallet);

// Get status for a specific wallet
var status = DynamicSDK.Instance.Wallets.Waas.Delegation.GetDelegationStatusForWallet(wallet.Id);
Debug.Log($"Status: {status}"); // delegated, pending, or denied
```

## Dismiss or deny delegation

```csharp theme={"system"}
// Dismiss the prompt for the current session only (resets on logout/restart)
await DynamicSDK.Instance.Wallets.Waas.Delegation.DismissDelegationPrompt();

// Or dismiss for a specific wallet
await DynamicSDK.Instance.Wallets.Waas.Delegation.DismissDelegationPrompt(walletId: "wallet-id");
```

<Card title="What's next?" icon="link" color="#4779FE" href="/docs/unity/wallets/embedded-wallets/mpc/delegated-access/receiving-delegation">
  Learn how to properly receive the delegation materials on your server
</Card>
