Installation
@stridge/gateway-kit is a single npm package shipped as ESM, typed end-to-end, with a small set of subpath entries for compound parts, dialogs, hooks, primitives, theming, i18n, and events.
Install the package
pnpm add @stridge/gateway-kitPeer dependencies
pnpm add react react-dom viemThe Kit declares these peers:
| Package | Range | When required |
|---|---|---|
react | ^19.0.0 | Always. The Kit relies on React 19 features (use(Ctx), ref-as-prop). |
react-dom | ^19.0.0 | Always. |
viem | >=2.48.1 <3 | Always. Address types and EVM utilities. |
wagmi | >=3.6.3 <4 | When you enable the deposit wallet method (paying from a connected EOA). The Kit reads wagmi via an optional bridge, so withdraw-only / QR-only integrations don't need it. |
The Kit's wagmi integration is opt-in by environment. If you never enable the deposit-wallet method, you can ship without wagmi installed. The Kit will detect the missing context and gate the wallet tile gracefully instead of throwing.
Import the global stylesheet
The Kit ships one CSS file containing every design token (--stridge-gk-*) and the four radius presets. Import it once at your app's entry — typically your root layout for Next.js, your main.tsx for Vite, or wherever you import global styles.
@import "@stridge/gateway-kit/styles.css";import "@stridge/gateway-kit/styles.css"
import "./globals.css"
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}The Kit's CSS is scoped — it only matches inside [data-stridge-scope], which the provider writes on its root wrapper, so it never bleeds into the rest of your app. See Theming & CSS variables for the full token reference.
Get a gateway key
The Kit authenticates with a gateway key: the ID of a live API key that carries the Gateway scope. The ID is not the key's secret, so it is safe to ship in your bundle, and you can copy it again from the dashboard at any time.
The gateway works with live keys only. A key from your sandbox gets 403 from every gateway route, so there is no sandbox for the Kit. Build your server-side flows in the sandbox and wire the Kit against your live workspace.
Sign in at dashboard.stridge.com (opens in a new tab), switch to live, and choose Developer → Gateway Kit → Create gateway kit. Enter a Brand name, which customers see in the checkout widget, and an Allowed origin such as app.example.com. Choose Create key.
The kit is an API key with only the Gateway scope. Any live key you give the Gateway scope under Developer → API Keys is listed here too.
The dialog shows the Gateway key. You can copy it again later from the kit's Overview.
Before shipping, review the kit's Settings:
- Referrer whitelist: the only origins that may use the key. Leave it empty and any origin can.
- Require same owner: funds settle only to the depositor's own address. It is on for a new kit.
- Destination control addresses: with Require same owner off, the only addresses funds may settle to. Leave it empty to allow any.
See Gateway Kit security for what each control buys you.
The key is browser-safe, so it ships in the bundle. The Kit conventionally reads it from a public env var:
NEXT_PUBLIC_STRIDGE_GATEWAY_KEY=<your-key>Subpath entry points
The Kit splits its surface across subpaths so consumers only import what they use. The bundler tree-shakes anything you don't reach for.
| Subpath | What's there |
|---|---|
@stridge/gateway-kit | <StridgeProvider />, Deposit, Withdraw, and Activity hooks, their state/snapshot types, and event bus types. No UI ships from this entry. |
@stridge/gateway-kit/deposit/dialog | <DepositDialog /> — the drop-in deposit flow. |
@stridge/gateway-kit/deposit/widgets | Zero-prop orchestrated deposit widgets — Deposit, AssetPicker, AmountEntry, ConfirmDeposit, TransferCrypto, ProcessingState, SuccessState, ErrorState, DepositStatusBanner, DepositActivityList, DepositActivityDetail, and DialogShell. The default surface for compound integrations. |
@stridge/gateway-kit/deposit/compound | Bare compound parts plus the FSM scaffolding (Deposit.Boundary / .Guards / .Steps / .Step). Reach for these when you need to wire data by hand or to mount the FSM router. |
@stridge/gateway-kit/withdraw/dialog | <WithdrawDialog /> — the drop-in withdraw flow. |
@stridge/gateway-kit/withdraw/widgets | Zero-prop orchestrated withdraw widgets — WithdrawForm, WithdrawInProgress, WithdrawSuccess, WithdrawError, WithdrawActivityList, WithdrawActivityDetail. |
@stridge/gateway-kit/withdraw/compound | Bare withdraw compound parts + the FSM scaffolding (Withdraw.Boundary / .Guards / .Steps / .Step). |
@stridge/gateway-kit/activity/dialog | <ActivityDialog /> — the drop-in standalone activity surface (read-only settlement history). |
@stridge/gateway-kit/activity/widgets | Zero-prop orchestrated activity widgets — ActivityList, ActivityDetail, and DialogShell. |
@stridge/gateway-kit/activity/compound | Bare Activity and ActivityDetail parts, ActivitySourceProvider for host-owned data, and controller-backed ActivityFlow.Boundary / .Steps / .Step routing, plus slots and payload types. |
@stridge/gateway-kit/ui | 23 lower-level primitives (Button, Card, Dialog, Select, AmountInput, TokenLogo, …). |
@stridge/gateway-kit/icons | The Kit's custom SVG icon set. |
@stridge/gateway-kit/wallet | useWalletState() and ConnectWalletConfig. |
@stridge/gateway-kit/format | Locale-aware formatters (formatTokenAmount, formatUsd, …). |
@stridge/gateway-kit/events | Typed event bus and subscription hooks. |
@stridge/gateway-kit/i18n | createGatewayKitI18n, defineMessages, hooks. |
@stridge/gateway-kit/i18n/locales/* | Per-locale catalog imports (e.g. …/locales/es). |
@stridge/gateway-kit/types | Additional shared payload, FSM, and DTO types. Activity controller, state, driver, and snapshot types export from the root entry instead. |
@stridge/gateway-kit/styles.css | The global stylesheet. |
Verify the install
A 10-second sanity check before you start building:
import { StridgeProvider, useDeposit } from "@stridge/gateway-kit"
import { DepositDialog } from "@stridge/gateway-kit/deposit/dialog"
function OpenButton() {
const { open } = useDeposit()
return <button onClick={() => open()}>Open deposit</button>
}
export function App() {
return (
<StridgeProvider
gatewayKey={process.env.NEXT_PUBLIC_STRIDGE_GATEWAY_KEY!}
asset={{ networkId: "9001", symbol: "USDC" }} // 9001 = Arbitrum One
flows={{
deposit: { destination: { address: "0x000…000" } },
}}
>
<OpenButton />
<DepositDialog />
</StridgeProvider>
)
}If the dialog opens and shows the chain & token picker, the Kit is installed correctly.
Next
- Provider — every
StridgeProviderprop. - Drop-in dialogs — open + close,
onSubmitcontract for withdraw. - Theming & CSS variables — restyle the Kit to match your app.