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-kit

Peer dependencies

pnpm add react react-dom viem

The Kit declares these peers:

PackageRangeWhen required
react^19.0.0Always. The Kit relies on React 19 features (use(Ctx), ref-as-prop).
react-dom^19.0.0Always.
viem>=2.48.1 <3Always. Address types and EVM utilities.
wagmi>=3.6.3 <4When 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.
Note

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";
app/layout.tsx — Next.js
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.

Note

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.

Create a gateway kit

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.

Copy the gateway key

The dialog shows the Gateway key. You can copy it again later from the kit's Overview.

Lock the key down

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.

Expose it via an env var

The key is browser-safe, so it ships in the bundle. The Kit conventionally reads it from a public env var:

.env.local
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.

SubpathWhat'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/widgetsZero-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/compoundBare 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/widgetsZero-prop orchestrated withdraw widgets — WithdrawForm, WithdrawInProgress, WithdrawSuccess, WithdrawError, WithdrawActivityList, WithdrawActivityDetail.
@stridge/gateway-kit/withdraw/compoundBare 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/widgetsZero-prop orchestrated activity widgets — ActivityList, ActivityDetail, and DialogShell.
@stridge/gateway-kit/activity/compoundBare 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/ui23 lower-level primitives (Button, Card, Dialog, Select, AmountInput, TokenLogo, …).
@stridge/gateway-kit/iconsThe Kit's custom SVG icon set.
@stridge/gateway-kit/walletuseWalletState() and ConnectWalletConfig.
@stridge/gateway-kit/formatLocale-aware formatters (formatTokenAmount, formatUsd, …).
@stridge/gateway-kit/eventsTyped event bus and subscription hooks.
@stridge/gateway-kit/i18ncreateGatewayKitI18n, defineMessages, hooks.
@stridge/gateway-kit/i18n/locales/*Per-locale catalog imports (e.g. …/locales/es).
@stridge/gateway-kit/typesAdditional shared payload, FSM, and DTO types. Activity controller, state, driver, and snapshot types export from the root entry instead.
@stridge/gateway-kit/styles.cssThe 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

Was this page helpful?