open-index/open-npm huggingface dataset:
npm package: @linkpane/mailer-post
Description: Submission-only SDK for Linkpane Mailer forms
Latest version: 1.0.2

# @linkpane/mailer-post

Submission-only SDK for Linkpane Mailer forms. Use this when you want to post
form data to a Linkpane inbox endpoint without managing forms.

Linkpane Mailer is a hosted form and email capture service by Haqqman. It allows you to collect form submissions and newsletter signups without building, deploying, or maintaining your own backend.

## Install

```bash
npm install @linkpane/mailer-post
```

## Usage

```ts
import { submitForm } from '@linkpane/mailer-post'

const result = await submitForm({
  apiBaseUrl: 'https://api.linkpane.com',
  pid: '12345',
  slug: 'contact-me',
  data: {
    firstName: 'Ada',
    lastName: 'Lovelace',
    email: 'ada@example.com',
    message: 'Hello from my website'
  }
})

if (!result.ok) {
  console.error(result.message, result.errors)
}
```

## Browser Helper

```ts
import { attachToForm } from '@linkpane/mailer-post'

const form = document.querySelector('#contact-form')
attachToForm(form, {
  apiBaseUrl: 'https://api.linkpane.com',
  pid: '12345',
  slug: 'contact-me',
  onSuccess: () => {},
  onError: () => {},
})
```

## Notes

### Required Fields (enforced by Linkpane Mailer)
- `email`
- `firstName`
- `lastName`

### Optional Fields
- Any additional fields in your form (custom questions, phone, message, etc.)
- `redhat` (honeypot field; keep empty)

### Origin Rules
For server-side usage, you must set an `Origin` header that matches the form’s
`source_url`. For mobile apps, submit through your backend proxy to satisfy
Linkpane’s Origin checks.
npm package: @linkpane/newsletter-subscribe
Description: Subscribe-only SDK for Linkpane Newsletter endpoints
Latest version: 1.0.2

# @linkpane/newsletter-subscribe

Subscribe-only SDK for Linkpane Newsletter endpoints. Use this to add email
subscribers without building your own newsletter backend.

Linkpane Mailer is a hosted form and email capture service by Haqqman. It allows you to collect form submissions and newsletter signups without building, deploying, or maintaining your own backend.

## Install

```bash
npm install @linkpane/newsletter-subscribe
```

## Usage

```ts
import { subscribeNewsletter } from '@linkpane/newsletter-subscribe'

const result = await subscribeNewsletter({
  apiBaseUrl: 'https://api.linkpane.com',
  username: 'my-newsletter',
  data: {
    email: 'subscriber@example.com',
    firstName: 'Ada',
    lastName: 'Lovelace'
  }
})

if (!result.ok) {
  console.error(result.message, result.errors)
}
```

## Notes

### Required Fields
Required fields depend on your Linkpane Newsletter configuration.
Most setups require:
- `email`

Common optional fields:
- `firstName`
- `lastName`

### Origin Rules
For browser usage, ensure the request Origin matches the configured source domain.
For server-side usage, you must set an `Origin` header that matches the configured
source domain.

### Server Usage
You can supply a custom `fetch` for server environments.
npm package: @linkpane/sdk
Description: Aggregate SDK for Linkpane integrations
Latest version: 1.0.2

# @linkpane/sdk

Linkpane Mailer is a hosted form and email capture service by Haqqman. It allows you to collect form submissions and newsletter signups without building, deploying, or maintaining your own backend.

Linkpane Mailer provides:
- Hosted form endpoints
- Inbox for form submissions
- Email notifications
- Newsletter subscription handling
- Simple SDKs for frontend integration

Learn more at `https://linkpane.com/mailer-forms`

This repository contains the official SDKs for interacting with Linkpane Mailer endpoints.

## Install

```bash
npm install @linkpane/sdk
```

## Usage

```ts
import { submitForm, subscribeNewsletter } from '@linkpane/sdk'

await submitForm({
  apiBaseUrl: 'https://api.linkpane.com',
  pid: '12345',
  slug: 'contact-me',
  data: { firstName: 'Ada', lastName: 'Lovelace', email: 'ada@example.com' }
})

await subscribeNewsletter({
  apiBaseUrl: 'https://api.linkpane.com',
  username: 'my-newsletter',
  data: { email: 'subscriber@example.com' }
})
```
## Which Package Should I Use?

- **I want all** → `@linkpane/sdk`
- **I want to submit a custom contact/lead form** → `@linkpane/mailer-post`
- **I want to add newsletter subscribers** → `@linkpane/newsletter-subscribe`

## Required Fields (Quick Guide)

Mailer form submissions require:
- `email`
- `firstName`
- `lastName`

Newsletter subscriptions typically require:
- `email`
Optional:
- `firstName`
- `lastName`