HiveProvider
Connects your app to the Hive blockchain with automatic endpoint fallback and health monitoring.
Usage
Provider Component
App.vue
<template>
<HiveProvider
:api-endpoints="endpoints"
:timeout="5000"
:health-check-interval="30000"
:on-endpoint-change="onEndpointChange"
>
<HomePage />
</HiveProvider>
</template>
<script setup lang="ts">
import { HiveProvider } from "@hiveio/honeycomb-vue";
import HomePage from "./pages/index.vue";
const endpoints = [
"https://api.hive.blog",
"https://api.openhive.network",
"https://api.syncad.com",
];
const onEndpointChange = (ep: string) => {
// handle endpoint change
};
</script>Child Component
MyComponent.vue
<template>
<div>
<p v-if="isLoading">Connecting...</p>
<p v-else-if="error">Error: {{ error }}</p>
<p v-else>Connected to {{ apiEndpoint }}</p>
</div>
</template>
<script setup lang="ts">
import { useHive } from "@hiveio/honeycomb-vue";
const { chain, isLoading, error, status, apiEndpoint } = useHive();
</script>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>