Welcome to the Tetrium Developer Platform. Tetrium provides an intelligent foundation for building advanced research tools, content management systems, and distributed state applications.
Prerequisites
Before you begin, ensure you have the following installed on your machine:
- Node.js v18.17 or higher
- npm or pnpm
- A Tetrium API Key (request one via the Admin Control Center)
The Tetrium Connect API is currently in closed beta. If you are part of the Founding Team, your API key is already provisioned in Firebase.
Installation
Install the Tetrium React SDK using your preferred package manager.
npm install @tetrium/react @tetrium/core
Or if you're using pnpm:
pnpm add @tetrium/react @tetrium/core
Quick Start
Initialize the Tetrium Provider at the root of your React or Next.js application.
import { TetriumProvider } from '@tetrium/react';
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<TetriumProvider apiKey={process.env.NEXT_PUBLIC_TETRIUM_KEY}>
{children}
</TetriumProvider>
</body>
</html>
);
}
Fetching Data
Once the provider is configured, you can use our built-in hooks to pull data from the Tetrium network.
import { usePublications } from '@tetrium/react';
export function RecentArticles() {
const { data, loading, error } = usePublications({ limit: 5 });
if (loading) return <div>Loading articles...</div>;
if (error) return <div>Error fetching data.</div>;
return (
<ul>
{data.map(article => (
<li key={article.id}>{article.title}</li>
))}
</ul>
);
}
Next Steps
Now that you have the SDK installed, explore the following resources to dive deeper into the ecosystem:
