What is TanStack Start?
TanStack Start is a full-stack React framework powered by TanStack Router. It provides full-document SSR, streaming, server functions, bundling, and more using tools like Nitro and Vite. It’s ready to deploy to your favorite hosting provider! TanStack Start uses Nitro and Vite to bundle and deploy your application, providing:- A unified API for SSR, streaming, and hydration
- Extraction of server-only code from your client-side code (e.g., server functions)
- Bundling your application for deployment to any hosting provider
Prerequisites
To use Para, you need an API key. This key authenticates your requests to Para services and is essential for integration.Don’t have an API key yet? Request access to the Developer Portal to create API keys, manage billing, teams, and more.
Installing Dependencies
First, install the Para React SDK and React Query using your preferred package manager: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. However, we only want to run these polyfills on the client, not on the server.- Install the Vite Node Polyfills plugin:
- Configure the polyfills in your
app.config.ts:
- Avoids loading node polyfills on the server where they’re unnecessary and can cause conflicts
- Sets
process.browserto true which helps modules determine the execution environment - Ensures proper resolution of browser-specific code paths
Setting Up the Para SDK
In TanStack Start, Para SDK components must be loaded client-side only to avoid SSR conflicts. This is accomplished using a combination ofReact.lazy for dynamic loading and ClientOnly from TanStack Router to prevent server rendering.
1
Create Environment Constants
First, set up your API key and environment constants in a file like
src/constants.ts:Para offers two hosted environments:
Environment.BETA (alias Environment.DEVELOPMENT) for testing, and
Environment.PROD (alias Environment.PRODUCTION) for live use. Select the environment that matches your current
development phase.2
Create a Providers Component
Create a providers component that will wrap your application with both the QueryClientProvider and lazy-loaded ParaProvider:The
ClientOnly component ensures that the ParaProvider is only rendered on the client side, preventing hydration mismatches. The fallback prop determines what to show during server-side rendering.3
Wrap Your App with Providers
Now, wrap your root component with the Providers component:
4
Lazy Load Para Components
For any component that uses Para SDK components, use the same approach with And in your
React.lazy and ClientOnly:ParaContainer.tsx:Beta Testing Credentials In the
BETA Environment, you can use any email ending in @test.getpara.com (like
dev@test.getpara.com) or US phone numbers (+1) in the format (area code)-555-xxxx (like (425)-555-1234). Any OTP
code will work for verification with these test credentials. These credentials are for beta testing only. You can
delete test users anytime in the beta developer console to free up user slots.Why Client-side Only Loading?
The Para SDK uses styled-components internally which can cause issues during server-side rendering. By usingReact.lazy and ClientOnly, we ensure Para components are only evaluated in the browser environment where styled-components works correctly.
Customizing the Para Modal
To provide the best experience for your users, you can customize the appearance of the Para Modal to match your application’s branding:ParaModalProps, refer to the customization guide:
Examples
For practical implementation of the Para SDK in TanStack Start applications, explore our example repository:Troubleshooting
Client-side Only Components
Client-side Only Components
If you encounter hydration mismatches or errors related to styled-components, ensure you’re using both:This dual approach ensures Para components are only evaluated and rendered on the client-side.
React.lazyto dynamically import Para componentsClientOnlyfrom TanStack router to prevent server rendering
Polyfill Issues
Polyfill Issues
If you encounter errors related to missing polyfills (like
crypto, buffer, etc.), verify:- You’ve installed
vite-plugin-node-polyfills - The polyfill plugin is correctly configured in your
app.config.tsunder therouters.client.vite.pluginssection process.browseris set totruein the basevitesection





