@stakekit/widget. It covers yield discovery, wallet connection, and the enter, exit and manage flows. It calls the Earn API with your project’s API key and shows only the yields enabled for that project. See Discover yields.
This guide covers the classic layout. For the dashboard layout with Borrow, Manage and Activity tabs, see Widget Pro. For Perps, see the Perps widget.
Prerequisites
- A Yield.xyz API key for the project whose yields you want to show. See API keys.
- React 19 or later if you use the React entry point (
SKApp). The browser renderer (renderSKWidget) does not require React on the host page.
The API key ships to the browser in every widget deployment. Read the security notice for the risks and how to limit them.
Install
@stakekit/widget exposes three entry points: the package root (SKApp, for React apps), ./bundle (renderSKWidget, framework-agnostic) and ./style.css (the stylesheet, required by both). If your app already uses React, the React entry point keeps your bundle smaller.
React
Import the stylesheet once, then renderSKApp with your API key:
Next.js
Render the widget in a client component and load it without server-side rendering:Browser renderer
renderSKWidget mounts the widget into a container element without React in your app:
From a script tag
Without a bundler, load the bundle and its stylesheet from a CDN:portalContainer so that dialogs and menus also render inside it.
Wallet and signing
By default the widget renders its own connect-wallet flow and signs with the wallet the user connects. To sign with your own signer, custody provider or embedded wallet instead, passexternalProviders:
sendTransaction(tx, txMeta)signs and broadcasts one transaction.tx.typeisevm,solana,ton,tronorbittensor. Once the transaction is broadcast, resolve with{ type: "success", txHash }. Resolve with{ type: "cancelled" }when the user declines, or{ type: "error", error }on failure. A plain hash string also works.signMessage(message)returns the signature string, or the samesuccess,cancelledorerrorresult.switchChain(chainId)resolves once your wallet is on that chain. UpdatecurrentChainafterward.currentAddressis""while the wallet is disconnected. KeepexternalProvidersin place; adding or removing it requires a remount.
txMeta carries the action type, transaction type, amounts and validators, so you can label the request that your users or approvers see.
To offer Zama confidential vaults with your own wallet, give the provider a signZamaPermit(typedData, meta) method (type SKZamaWallet). Without it, Zama deposits are blocked. See Zama.
To add Borrow to the same widget, see the Borrow widget guide.
Tracking
Passtracking to receive the widget’s analytics events:
trackEvent fires on interactions such as "Connect wallet clicked", "Yield selected", "Transaction signed" and "Transaction submitted". trackPageView fires on screens such as "Earn", "Positions", "Stake review" and "Stake complete". The SKTrackEvent and SKTrackPage types list every value.
Theming
lightTheme and darkTheme are the built-in themes. Pass a partial theme as theme: it is deep-merged over the light theme, so you set only the tokens you change.
lightTheme or darkTheme based on prefers-color-scheme in your app and pass it as theme.
Theme tokens
Theme tokens
Every token is a CSS value string. All groups are optional.
The
connectKit color and radius groups were removed in 0.0.290. Remove them from your theme if you set them.Configuration reference
Every prop below is optional exceptapiKey. Props marked Mount are read when the widget mounts; remount it to change them. The rest update live.
All props
All props
EvmChainIds, MiscChainIds, SubstrateChainIds), DashboardYieldCategory, the themes, and a named type for every prop. Import them rather than copying their shapes.
Upgrading to 0.0.290
Changes that can affect an existing integration
Changes that can affect an existing integration
- React 19. The
reactandreact-dompeers are>=19. - Wallet dialogs. RainbowKit is replaced by the widget’s own connect, account and chain dialogs and its own WalletConnect. Existing Tron, Cosmos and Polkadot WalletConnect sessions reconnect once after the update.
- Removed:
forceWalletConnectOnly, thecolor.connectKitandborderRadius.connectKittheme groups,wagmi.__customConnectors__andmapWalletListFn(usewalletPolicy),disableGasCheck, and thecreateWallet,evmChainGroupandTrackingContextProviderexports. - Adapter results.
sendTransactionandsignMessagecan resolve{ type: "cancelled" }when the user declines; the widget shows a retryable notice. - Browser renderer.
renderSKWidgetreturns{ rerender, unmount }. - Deprecated, no effect:
tokensForEnabledYieldsOnlyandexternalProviders.supportsBorrow. Remove them.
Verify
Run your app and confirm three things. The widget loads your project’s yields, matching whatGET /v1/yields returns for the same API key. Connecting a wallet, or passing externalProviders, shows a balance. A transaction signs and settles as described in Enter and exit flows.
Next steps
Widget Pro
The dashboard layout of the same widget, with Borrow, Manage and Activity tabs.
Borrow widget
Turn on Borrow in the widget.
Enter and exit flows
What the widget’s enter, exit and manage flows do at the API level.
Discover yields
Confirm which yields your project’s API key exposes.

