Installation
Install starknet-tokenkit and configure it in your project
Install the package
Pick your package manager. styled-components is a peer dependency — install both.
Peer dependencies
react, react-dom, and styled-components are peer dependencies. The SDK is tested with React 19 and Next.js; React 18 also works.
bash
1npm install react react-dom styled-componentsInfo
You do not need `starknet.js` for the SDK to work. The SDK pulls token data from TokenKit's API, not from a Starknet RPC. When you want to send transactions, pair the SDK with `starknet-react` or `get-starknet`.
Configure via TokenKitWrapper
The SDK has no configure(...) call — configuration lives on the TokenKitWrapper component. Mount it once near your app root.
tsx
1import { TokenKitWrapper, themes } from 'starknet-tokenkit';2 3export default function App({ children }) {4 return (5 <TokenKitWrapper6 network="SN_MAIN"7 apiKey={process.env.NEXT_PUBLIC_TOKENKIT_API_KEY!}8 mainnetEndpoint="https://api.tokenkithq.io"9 sepoliaEndpoint="https://api.sepolia.tokenkithq.io"10 themeObject={themes.dark}11 options={{ tokensToLoad: 'public', enableRecent: true }}12 >13 {children}14 </TokenKitWrapper>15 );16}| Prop | Type | Notes |
|---|---|---|
network | 'SN_MAIN' | 'SN_SEPOLIA' | Which Starknet chain to query against. |
apiKey | string | Your TokenKit API key. See API Keys. |
mainnetEndpoint | string | Base URL for the mainnet API (typically https://api.tokenkithq.io). |
sepoliaEndpoint | string | Base URL for the sepolia API. |
themeObject | Theme | A theme preset (themes.dark, themes.lavender, ...) or your own. See Themes. |
options | TokenKitOptions | Optional. { tokensToLoad?: 'all' | 'public', enableRecent?: boolean }. Defaults: 'public', false. |
origin | string | Optional. Sent as X-Origin on API requests — useful for browser-extension wallets (e.g. 'chrome-extension://<id>'). |
Tip
If you manage your own `ThemeProvider` already, use `TokenKitProvider` instead of `TokenKitWrapper` — it has identical props minus `themeObject`, and skips re-wrapping in styled-components.
TypeScript
Types are bundled. No @types/... to install.
tsx
1import type { IToken, Theme, TokenKitOptions } from 'starknet-tokenkit';Verify it works
Drop a SelectTokenModal inside the wrapper, run dev, and click the trigger. You should see USDC, USDT, ETH, STRK, and friends.
tsx
1import { useState } from 'react';2import { SelectTokenModal, type IToken } from 'starknet-tokenkit';3 4export default function VerifyToken() {5 const [selected, setSelected] = useState<IToken | null>(null);6 return (7 <SelectTokenModal selectedToken={selected} callBackFunc={setSelected}>8 <button>{selected?.symbol ?? 'Open picker'}</button>9 </SelectTokenModal>10 );11}If the list is empty:
- Confirm the wrapper's
apiKeyis valid (noAuthorization: Beareris used — the SDK sendsapi-keyand optionalX-Origin) - Check the browser console for CORS errors — your origin must be allow-listed for that API key
See also
- Getting Started — what each component does
SelectTokenModal— full prop reference- Theming — light, dark, and custom themes
- Full example — a working app with a wallet wired in