Skip to main content

@fedify/h3@2.1.2
Built and signed on GitHub Actions

Works with
This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score100%
License
MIT
Downloads1/wk
Published2 days ago (2.1.2)

Integrate Fedify with h3

@fedify/h3: Integrate Fedify with h3

JSR npm Matrix Follow @fedify@hollo.social

This package provides a simple way to integrate Fedify with h3, an HTTP server framework behind Nitro, Analog, Vinxi, SolidStart, TanStack Start, and other many web frameworks.

The integration code looks like this:

import { createApp, createRouter } from "h3";
import { integrateFederation, onError } from "@fedify/h3";
import { federation } from "./federation";  // Your `Federation` instance

export const app = createApp({ onError });
app.use(
  integrateFederation(
    federation,
    (event, request) => "context data goes here"
  )
);

const router = createRouter();
app.use(router);
Note

Your app has to configure onError to let Fedify negotiate content types. If you don't do this, Fedify will not be able to respond with a proper error status code when a content negotiation fails.

Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@fedify/h3

Import symbol

import * as h_ from "@fedify/h3";
or

Import directly with a jsr specifier

import * as h_ from "jsr:@fedify/h3";