npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@p4it-kft/ra-data-hydra

v1.1.0

Published

React-admin data provider for Hydra-enabled APIs with Mercure real-time support.

Readme

@p4it-kft/ra-data-hydra

A react-admin data provider for APIs supporting the Hydra Core Vocabulary, including APIs created using the API Platform framework.

Based on the data provider from @api-platform/admin, extracted as a standalone lightweight package that depends on ra-core instead of the full react-admin UI bundle.

Installation

yarn add @p4it-kft/ra-data-hydra

Note: This package provides only the data provider. You need react-admin (or at minimum ra-core) installed in your application.

Usage

import { Admin, Resource, ListGuesser, EditGuesser } from 'react-admin';
import { dataProvider } from '@p4it-kft/ra-data-hydra';

const hydraDataProvider = dataProvider({
  entrypoint: 'https://demo.api-platform.com',
});

const App = () => (
  <Admin dataProvider={hydraDataProvider}>
    <Resource name="books" list={ListGuesser} edit={EditGuesser} />
    <Resource name="reviews" list={ListGuesser} edit={EditGuesser} />
  </Admin>
);

export default App;

With Authentication

import { dataProvider, fetchHydra } from '@p4it-kft/ra-data-hydra';

const httpClient = (url, options = {}) => {
  const token = localStorage.getItem('token');
  return fetchHydra(url, {
    ...options,
    headers: {
      ...options.headers,
      Authorization: token ? `Bearer ${token}` : undefined,
    },
  });
};

const hydraDataProvider = dataProvider({
  entrypoint: 'https://demo.api-platform.com',
  httpClient,
});

With Custom API Documentation Parser

import { dataProvider } from '@p4it-kft/ra-data-hydra';
import { parseHydraDocumentation } from '@api-platform/api-doc-parser';

const hydraDataProvider = dataProvider({
  entrypoint: 'https://demo.api-platform.com',
  apiDocumentationParser: parseHydraDocumentation,
});

Features

  • Parses Hydra API documentation to discover resources and fields
  • Implements all react-admin data provider methods (getList, getOne, create, update, delete, etc.)
  • Supports pagination, filtering, and sorting
  • Handles JSON-LD format and Hydra collections
  • Supports file uploads via multipart/form-data
  • Supports embedded resources
  • TypeScript support with full type definitions

API

dataProvider(options)

Creates a react-admin data provider for Hydra APIs.

Options:

  • entrypoint (string, required): The API entrypoint URL
  • httpClient (function): Custom HTTP client (defaults to fetchHydra)
  • apiDocumentationParser (function): Custom API documentation parser
  • mercure (object|boolean): Mercure real-time updates configuration
  • useEmbedded (boolean): Enable embedded resource support (default: true)
  • disableCache (boolean): Disable the local embedded documents cache (default: false)
  • keyPrefix (string): The prefix used for Hydra JSON-LD keys in API responses (default: 'hydra:'). Set to '' if your API returns unprefixed keys (e.g. member instead of hydra:member).

fetchHydra(url, options)

HTTP client for Hydra APIs that handles JSON-LD content negotiation.

schemaAnalyzer()

Creates a schema analyzer for extracting field metadata from Hydra documentation.

Exports

// Data provider factory
export { dataProvider } from '@p4it-kft/ra-data-hydra';

// HTTP client
export { fetchHydra } from '@p4it-kft/ra-data-hydra';

// Schema analyzer
export { schemaAnalyzer } from '@p4it-kft/ra-data-hydra';

// Utility
export { transformJsonLdDocumentToReactAdminDocument } from '@p4it-kft/ra-data-hydra';

// Types
export type {
  ApiPlatformAdminRecord,
  ApiPlatformAdminDataProvider,
  HydraDataProviderFactoryParams,
  HydraCollection,
  HydraHttpClientResponse,
  HttpClientOptions,
  MercureOptions,
  SchemaAnalyzer,
  FilterParameter,
  IntrospectPayload,
} from '@p4it-kft/ra-data-hydra';

Documentation

Credits

Based on the Hydra data provider from @api-platform/admin, originally created by Kévin Dunglas.

License

MIT