HiveProvider
Connects your app to the Hive blockchain with automatic endpoint fallback and health monitoring.
Usage
import { HiveProvider } from "@hiveio/honeycomb-react";
function App() {
return (
<HiveProvider
apiEndpoints={[
"https://api.hive.blog",
"https://api.openhive.network",
"https://api.syncad.com",
]}
timeout={5000}
healthCheckInterval={30000}
onEndpointChange={(ep) => {
// handle endpoint change
}}
>
<YourApp />
</HiveProvider>
);
}// app/providers.tsx
"use client";
import { HiveProvider } from "@hiveio/honeycomb-react";
export function Providers({ children }: { children: React.ReactNode }) {
return (
<HiveProvider
apiEndpoints={[
"https://api.hive.blog",
"https://api.openhive.network",
"https://api.syncad.com",
]}
timeout={5000}
healthCheckInterval={30000}
onEndpointChange={(ep) => {
// handle endpoint change
}}
>
{children}
</HiveProvider>
);
}
// app/layout.tsx
import { Providers } from "./providers";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html>
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
apiEndpoints | string[] | DEFAULT_API_ENDPOINTS | API endpoints in priority order |
timeout | number | 5000 | Request timeout in ms |
healthCheckInterval | number | 30000 | Health check interval in ms (0 = disabled) |
onEndpointChange | (endpoint: string) => void | undefined | Called when active endpoint changes |
Default Endpoints
When no apiEndpoints prop is provided, these endpoints are used (in priority order):
https://api.hive.blog
https://api.openhive.network
https://api.syncad.com
Public Nodes
| Node | Provider | Default |
|---|---|---|
api.hive.blog | @blocktrades | Yes |
api.openhive.network | @gtg | Yes |
api.syncad.com | @gtg | Yes |
anyx.io | @anyx | |
rpc.ausbit.dev | @ausbitbank | |
hive-api.arcange.eu | @arcange | |
api.deathwing.me | @deathwing | |
rpc.mahdiyari.info | @mahdiyari | |
techcoderx.com | @techcoderx | |
hive.roelandp.nl | @roelandp |
Automatic Selection
HiveProvider automatically tests all endpoints and connects to the fastest responding node.
Running Your Own Node
For production apps with high traffic, consider running your own node. See the Hive Developer Portal for instructions.
Custom Nodes
You can provide your own list of API endpoints:
import { HiveProvider } from "@hiveio/honeycomb-react";
<HiveProvider
apiEndpoints={[
"https://api.syncad.com",
"https://api.openhive.network",
"https://anyx.io",
"https://rpc.ausbit.dev",
]}
>
{children}
</HiveProvider>