open-index/open-npm huggingface dataset:
npm package: @pdfn/next
Description: Next.js plugin for pdfn - Pre-compiles Tailwind CSS for optimized PDF generation
Author: gokulsiva
Latest version: 2.0.3

# @pdfn/next

Next.js plugin for pdfn. Pre-compiles Tailwind CSS for edge deployment.

## When needed

Recommended for all Next.js projects. Handles Tailwind pre-compilation for edge runtimes and client component bundling.

## Installation

```bash
npm install @pdfn/next
```

## Setup

```ts
// next.config.ts
import type { NextConfig } from 'next';
import { withPdfn } from '@pdfn/next';

const nextConfig: NextConfig = {
  // your existing config
};

export default withPdfn()(nextConfig);
```

### With Options

```ts
// next.config.ts
import type { NextConfig } from 'next';
import { withPdfn } from '@pdfn/next';

const nextConfig: NextConfig = {};

export default withPdfn({
  tailwind: true,  // Enable Tailwind pre-compilation (default: true)
  debug: false,    // Enable debug logging (default: false)
})(nextConfig);
```

### Composing with Other Plugins

```ts
// next.config.ts
import type { NextConfig } from 'next';
import { withPdfn } from '@pdfn/next';

const nextConfig: NextConfig = {};

// Nest plugins (innermost runs first)
export default withPdfn()(
  withOtherPlugin()(nextConfig)
);
```

## Usage

```tsx
// app/api/invoice/route.tsx
import { pdfn } from '@pdfn/react';
import Invoice from '@/pdfn-templates/invoice';

const client = pdfn(process.env.PDFN_API_KEY);

export async function GET() {
  const { data, error } = await client.generate({ react: <Invoice /> });

  if (error) {
    return new Response(error.message, { status: 500 });
  }

  return new Response(data.buffer, {
    headers: { 'Content-Type': 'application/pdf' },
  });
}
```

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `tailwind` | `boolean` | `true` | Pre-compile Tailwind CSS for edge runtime |
| `debug` | `boolean` | `false` | Enable debug logging |

## Requirements

- Node.js 22+
- Next.js 14+
- Tailwind CSS 4+

## License

MIT
npm package: @pdfn/tailwind
Description: Tailwind CSS support for PDFN
Author: gokulsiva
Latest version: 0.2.3

# @pdfn/tailwind

Tailwind CSS support for pdfn.

> **Server-only** — Tailwind processing runs during HTML generation, not in browsers.

## Installation

```bash
npm install @pdfn/tailwind
```

## Quick Start

Wrap your template with `<Tailwind>`:

```tsx
import { Document, Page } from '@pdfn/react';
import { Tailwind } from '@pdfn/tailwind';

function Invoice() {
  return (
    <Document>
      <Tailwind>
        <Page size="A4">
          <h1 className="text-2xl font-bold text-blue-600">Invoice</h1>
          <p className="text-gray-600 mt-2">Thank you for your purchase.</p>
        </Page>
      </Tailwind>
    </Document>
  );
}
```

## Custom Theme

Create `pdfn-templates/styles.css` for custom fonts and colors. This file is isolated from your app's styles — your app and PDF templates never interfere with each other.

```css
/* pdfn-templates/styles.css */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
@import "tailwindcss";

@theme {
  --font-inter: "Inter", var(--font-sans);
  --color-brand: #007bff;
}
```

Auto-detected when you use `<Tailwind>`.

## Edge Runtimes

`@pdfn/tailwind` works on Node.js but not on edge runtimes (no filesystem).

For Vercel Edge or Cloudflare Workers, add a build plugin:

```bash
# Next.js
npm i @pdfn/next

# Vite
npm i @pdfn/vite
```

See [@pdfn/next](../next) or [@pdfn/vite](../vite) for setup.

## License

MIT
npm package: @pdfn/vite
Description: Vite plugin for pdfn - Pre-compiles Tailwind CSS for edge runtime support
Author: gokulsiva
Latest version: 2.0.2

# @pdfn/vite

Vite plugin for pdfn. Pre-compiles Tailwind CSS for edge deployment.

## When Needed

Only for edge deployments (Cloudflare Workers, etc.). Not required for Node.js.

## Installation

```bash
npm install @pdfn/vite
```

## Setup

```ts
// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { pdfn } from '@pdfn/vite';

export default defineConfig({
  plugins: [react(), pdfn()],
});
```

### With Options

```ts
// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { pdfn } from '@pdfn/vite';

export default defineConfig({
  plugins: [
    react(),
    pdfn({
      tailwind: true,  // Enable Tailwind pre-compilation (default: true)
      debug: false,    // Enable debug logging (default: false)
    }),
  ],
});
```

## Usage

```tsx
// src/generate-pdf.tsx
import { pdfn } from '@pdfn/react';
import Invoice from './pdfn-templates/invoice';

const client = pdfn(process.env.PDFN_API_KEY);

export async function generateInvoice() {
  const { data, error } = await client.generate({ react: <Invoice /> });

  if (error) {
    console.error(error.message);
    return null;
  }

  return data.buffer;
}
```

## Options

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `tailwind` | `boolean` | `true` | Pre-compile Tailwind CSS for edge runtime |
| `debug` | `boolean` | `false` | Enable debug logging |

## Requirements

- Vite 5+
- Tailwind CSS 4+

## License

MIT
npm package: @pdfously/mcp
Description: MCP server for PDFously - agentic PDF generation and template management
Latest version: 1.0.6

# @pdfously/mcp

MCP server for [PDFously](https://pdfously.com) — agentic PDF generation and template management.

## Tools

- **list_templates** — List all PDF templates
- **get_template** — Get template details and structure
- **create_template** — Create a new PDF template with components
- **generate_pdf** — Generate a PDF from a template with data
- **get_generation** — Check generation status and get download URL

## Setup

Get your API key from [pdfously.com](https://pdfously.com).

### Claude Desktop

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "pdfously": {
      "command": "npx",
      "args": ["-y", "@pdfously/mcp"],
      "env": {
        "PDFOUSLY_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

### Environment Variables

| Variable | Required | Description |
|---|---|---|
| `PDFOUSLY_API_KEY` | Yes | Your PDFously API key |
| `PDFOUSLY_BASE_URL` | No | Custom API base URL (default: `https://pdfously.com`) |

## License

MIT