React component library and client SDK for integrating with the Sage Bionetworks Synapse API. Current stable version is 4.0.9, released monthly. Provides pre-built React components (EntityFinder, SynapseTable, etc.) along with React Query hooks and a SynapseContextProvider for managing authentication and caching. Supports TypeScript, MUI theming, and SCSS customization. Differentiated by official Synapse platform integration and a comprehensive set of data access and visualization widgets for biomedical research portals.
npm install synapse-react-clientVerified import paths — ran on the pinned version, not inferred.
Shows minimal setup with QueryClientProvider, SynapseContextProvider, and EntityFinder component.
Upgrade React and React DOM to >=19.2.0. If on React 18, stay on v3.x.
Convert to ES module imports. Use 'import' syntax instead of require.
Wrap your component tree with SynapseContextProvider and provide an accessToken.
Obtain token via secure OAuth flow or environment variables (server-side). Provide as prop to SynapseContextProvider.
Check changelog for breaking changes. For v3->v4 migration, consult upgrade guide.
Run 'npm install synapse-react-client' and ensure import is correct: 'import { ... } from "synapse-react-client"'Wrap component tree with <SynapseContextProvider synapseContext={{ accessToken: '...' }}>...</SynapseContextProvider>Wrap app with <QueryClientProvider client={queryClient}> from @tanstack/react-queryUse ES module import syntax instead of require(). Set type: 'module' in package.json if needed.