Skip to main content
This guide will walk you through integrating Para SDK with TanStack Start while preserving server-side rendering (SSR) capabilities.
TanStack Start is a full-stack React framework powered by TanStack Router. Para SDK uses styled-components internally which requires client-side only loading to work correctly with SSR.

Prerequisites

Before starting, you’ll need a Para API key which you can obtain from the . You can learn to create your account and get your API key from the Developer Portal.

Installation

Install the Para React SDK and React Query:
Using wagmi v3? See additional dependencies required.

Setting Up Polyfills with TanStack Start

Since TanStack Start uses Vite under the hood, we need to set up polyfills for modules like crypto, buffer, etc. that Para SDK relies on. We only want to run these polyfills on the client, not on the server.
  1. Install the Vite Node Polyfills plugin:
  1. Configure the polyfills in your app.config.ts:
app.config.ts

Setup Postinstall Script

Add the Para setup script to your package.json:
package.json

Create a Client-Only Providers Component

Create a providers component using React.lazy and ClientOnly to ensure Para SDK only loads on the client:
src/components/Providers.tsx
If you’re using a legacy API key (one without an environment prefix) you must provide a value to the paraClientConfig.environment. You can retrieve your updated API key from the Para Developer Portal at https://developer.getpara.com/

Wrap Your App with Providers

Update your root component to wrap your application with the Providers component:
src/routes/__root.tsx
You can learn more about the ParaProvider and its definition in the .
The ParaProvider utilizes libraries like Wagmi, Graz, and Solana Wallet Adapter, to power wallet connections. Meaning you can use any of the hooks provided by these libraries when within the ParaProvider context. You can learn more about using external wallets in the .

Create a Client-Only Connect Component

Create a component that uses Para SDK hooks, ensuring it’s only rendered on the client:
src/components/ParaContainer.tsx
Learn more about the hooks used in this example:
  • - Control the Para modal programmatically (openConnectModal, openWalletModal)
  • - Get account connection status and wallet details
Use it in your pages with ClientOnly wrapper:
The import "@getpara/react-sdk/styles.css" is required for the Para modal to display correctly. Without this import, the modal will not be visible. You can import it in your root route or any page that uses Para components.
src/routes/index.tsx
The Para SDK uses styled-components internally which can cause issues during server-side rendering. By using React.lazy and ClientOnly, we ensure Para components are only evaluated in the browser environment where styled-components works correctly.

Example

Next Steps

Success you’ve set up Para with TanStack Start! Now you can expand your application with wallet connections, account management, and more.