# App Integration

> Connect your app to Slush Wallet using the Slush Wallet SDK and wallet standard.

> **Note:** If you are using `dapp-kit`, you do not need to install any additional packages to integrate with
> the Slush wallet. [Read how to integrate with dapp-kit.](/dapp-kit/legacy/slush)

Using the Slush Wallet SDK, you can allow users to connect to the Slush wallet from your app. The
wallet is provided through the [Wallet Standard](https://docs.sui.io/standards/wallet-standard), and
should appear automatically in your existing wallet connection UI.

> The Slush Wallet SDK is only needed if you want to support the Slush web wallet in your app. If
> you want to integrate with the Slush browser extension or native mobile wallet, you do not need to
> install any additional packages - they will work automatically through the Wallet Standard.

## Setup

To use the Slush web wallet, you will need to register it in your application, using
`registerSlushWallet`. This only needs to be done once, and should be done as early as possible in
your application's lifecycle.

`registerSlushWallet` takes two arguments:

- `name`: The name of your app. This is shown to the user when they are asked to approve the
  connection in Slush.
- `options`: An optional object with the following properties:
  - `origin`: The origin of the Slush website. Defaults to `https://[TODO]`.
  - `network`: The network that you would like the Slush wallet to use. Defaults to `mainnet`,
    supports `mainnet` and `testnet`.

```ts

registerSlushWallet('Your dApp Name');
```

## Supported features

The Slush wallet currently supports the following features:

- `signTransaction`
- `signAndExecuteTransaction`
- `signPersonalMessage`

## Detecting the Slush wallet

If you'd like to detect whether the user is connected to the Slush wallet, you can use the `id` or
`name` property on the wallet

For example, if you are using `dapp-kit`, you can use the `useCurrentWallet` hook to get the current
wallet, and check if it is the Slush wallet.

```ts

function SlushOnly() {
	const { currentWallet } = useCurrentWallet();
	const walletIsSlushWallet = currentWallet?.name === SLUSH_WALLET_NAME;

	// rest of component logic...
}
```

# Migration from Stashed Wallet to Slush Wallet

If you're currently using `@mysten/zksend`'s `registerStashedWallet` directly, you should migrate to
the `@mysten/slush-wallet` package to ensure compatibility with the new Slush experience.

## Installation

```bash
pnpm install @mysten/slush-wallet
```

## Migration

If you're using `registerStashedWallet`, switch to `registerSlushWallet`:

**Before:**

```ts

registerStashedWallet(...);
```

**After:**

```ts

registerSlushWallet(...);
```

If you're using dapp-kit, update to the latest dapp-kit version and change the `stashedWallet` prop
on WalletProvider to `slushWallet`

> In the connect modal, users with the Slush Wallet extension installed only see the extension. If
> they don’t have it, the connection defaults to the Slush web app.