Quickstart
By the end of this page your app has a sign-in button, runs a gas-free Sui transaction from the user's account and opens the deposit panel.
#1. Get a platform key
Log in to the dashboard and:
- Under API keys, create a key. It is public by design: it identifies your platform, it doesn't authorize anything on its own.
- Under Settings → Allowed origins, add every origin your app runs on, for example
https://app.example.com. The key frame refuses to work anywhere else. Until you add one, it only answers onlocalhost. - Under Billing, top up. Sponsored transactions are paid from this balance.
#2. Install
npm i @ika-accounts/sdk @mysten/suiDuring the pilot the SDK is shared directly with partners rather than through the public npm registry. Ask us for the package.
#3. Create the client
Create one instance for your whole app.
import { createIkaAccounts } from '@ika-accounts/sdk';
export const accounts = createIkaAccounts({
apiKey: 'ika_…', // from the dashboard
apiUrl: 'https://ika-accounts.mpckit.xyz',
keysOrigin: 'https://ika-accounts.mpckit.xyz', // where users' keys live
network: 'mainnet',
});
accounts.preload(); // fetch Ika parameters in the background (~20 MB, cached)#4. Sign in
openConnect() shows the Ika Accounts sign-in modal: every EVM and Solana wallet installed in the browser, grouped, with its own icon.
const addresses = await accounts.openConnect(); // null if the user closed it
if (addresses) console.log('Sui address', addresses.sui);When the user comes back, reconnect without any prompt:
await accounts.reconnect(); // resolves null if there's nothing to restoreThe Sui address is available immediately. The account's keys finish in the background, and the first transaction waits for them automatically.
#5. Run a transaction
Pass a Sui Transaction, or steps that add to one. Gas is sponsored, so don't use the gas coin.
import { coinWithBalance } from '@mysten/sui/transactions';
const { digest } = await accounts.execute((tx, { address }) => {
const payment = coinWithBalance({ type: '0x2::sui::SUI', balance: 100_000_000n, useGasCoin: false });
const item = tx.moveCall({ target: `${PACKAGE}::shop::buy`, arguments: [tx.object(SHOP), payment] });
tx.transferObjects([item], address);
});The user's wallet shows what the transaction does and how their balances change, and asks them to approve. The first transaction also creates their dWallet.
#6. Let users add funds
await accounts.openFunds({ tab: 'deposit', receive: 'SUI' });The panel lists the user's balances on every chain, quotes what will arrive on Sui, and sends the deposit from their wallet with one confirmation. The same panel handles withdrawals: openFunds({ tab: 'withdraw' }).
#Next
- Skip the wallet prompt for routine transactions with sessions.
- Fund a transaction and run it in one call with
perform. - Using React? See React hooks.