v0.1 - Early preview

Embed forms
without the iframe

brij.js lets you embed business flows - contact forms, onboarding, checkout - into any external website. Schema-driven, no redirect, no iframe. Your host controls the data.

Get started Try the demo
~12kb
gzipped
0
dependencies
ESM
+ CJS + UMD
MIT
open source
your-site.js
import { Brij } from 'brij'

// initialize once
Brij.init({
  host: 'https://app.yourco.com',
  apiKey: 'pk_live_...'
})

// open a form by slug - anywhere on the page
document.querySelector('#contact-btn').addEventListener('click', () =>
  Brij.open('contact', {
    mode: 'panel',
    onSuccess: (data) => console.log('Submitted', data)
  })
)

How it works

01

Your server defines the form

Return a JSON schema from GET /brij/schema/:slug. No deploy needed to change fields - update the schema and it's live instantly.

02

Call Brij.open() on click

brij.js fetches the schema, injects the form into the host DOM, and handles multi-step navigation and validation.

03

Submission goes to your server

On submit, brij.js POSTs FormData to your /brij/submit/:slug endpoint. Your onSuccess callback fires with the response.

The old way vs brij.js

Without brij.js
  • Embed an iframe and lose control of styling
  • Redirect users away from your page to fill a form
  • Postmessage hacks to communicate back
  • Rebuild and redeploy to change a field
  • No native integration with your host app state
With brij.js
  • Form renders natively in the host DOM
  • No redirect - users stay on your page
  • onSuccess / onError callbacks, no postMessage
  • Change the schema server-side, live instantly
  • Full access to host app context in callbacks

Everything you need

No iframe, no redirect

Forms render directly in the host DOM. Full control over z-index, focus, and layout.

📐

Schema-driven

Your server defines the form shape. brij.js fetches the schema at runtime - no rebuild needed to change fields.

🔌

Drop-in script

One init call, then open any form by slug. Works in any JS environment - React, Vue, vanilla, no framework.

🧩

Multi-step flows

Steps with back/next navigation are built in. Each step validates before advancing.

🎨

Panel or modal

Slide-in side panel or centered modal. Pick per open() call, or let the user decide.

🔒

API key auth

Every request includes your API key header. The host validates it - brij.js never stores submission data.

Works with any stack

React Next.js Vue Svelte Astro Vanilla JS Angular Remix
terminal
$ npm install brij

Ready to embed your first form?

Installation takes under a minute. The quick-start gets you to a working form in 10 lines.

View installation guide Browse docs