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

@formalingo/sdk

v0.1.3

Published

Official TypeScript SDK for the Formalingo API

Downloads

48

Readme

@formalingo/sdk

Official TypeScript SDK for the Formalingo API — build and manage AI-powered forms and document signing programmatically.

Installation

npm install @formalingo/sdk
# or
yarn add @formalingo/sdk
# or
pnpm add @formalingo/sdk

Quick Start

import { createClient } from "@formalingo/sdk"

const client = createClient("af_live_YOUR_API_KEY")

// List all forms
const forms = await client.forms.get()

// Create a form
const form = await client.forms.post({
  body: {
    title: "Customer Feedback",
    description: "Help us improve our service",
  },
})

Setup

Get Your API Key

  1. Log in to Formalingo
  2. Go to Settings > API Keys
  3. Create a new key

Initialize the Client

import { createClient } from "@formalingo/sdk"

// Production (default)
const client = createClient("af_live_YOUR_API_KEY")

// Custom base URL (e.g., local development)
const client = createClient("af_live_YOUR_API_KEY", "http://localhost:3000")

Usage Examples

Forms

// List forms
const forms = await client.forms.get()

// Get a specific form
const form = await client.forms.byFormId("form-id").get()

// Update a form
await client.forms.byFormId("form-id").put({
  body: { title: "Updated Title", status: "published" },
})

// Delete a form
await client.forms.byFormId("form-id").delete()

Sections & Questions

const formApi = client.forms.byFormId("form-id")

// Create a section
const section = await formApi.sections.post({
  body: { title: "Personal Info", order: 0 },
})

// Add a question
const question = await formApi.questions.post({
  body: {
    sectionId: section.id,
    type: "short_text",
    title: "What is your name?",
    required: true,
    order: 0,
  },
})

// Multiple choice question
await formApi.questions.post({
  body: {
    sectionId: section.id,
    type: "mcq",
    title: "How did you hear about us?",
    required: false,
    order: 1,
    options: {
      choices: ["Search engine", "Social media", "Friend", "Other"],
    },
  },
})

Recipients

// Create a recipient (generates a shareable link)
const recipient = await client.forms.byFormId("form-id").recipients.post({
  body: {
    label: "John Doe",
    prefill: { name: "John Doe", email: "[email protected]" },
  },
})

// The shareable form URL
const formUrl = `https://www.formalingo.com/f/${recipient.token}`

Branding

await client.forms.byFormId("form-id").branding.put({
  body: {
    primaryColor: "#4F46E5",
    backgroundColor: "#F9FAFB",
    welcomeHeading: "Welcome!",
    welcomeSubtitle: "This will only take a minute.",
    thankYouHeading: "Thank you!",
    thankYouMessage: "Your response has been recorded.",
  },
})

Documents

// List documents
const documents = await client.documents.get()

// Create a document with signers
const doc = await client.documents.post({
  body: {
    title: "NDA Agreement",
    content: "Full document text...",
    signers: [
      { name: "Alice", email: "[email protected]" },
      { name: "Bob", email: "[email protected]" },
    ],
  },
})

Error Handling

try {
  const form = await client.forms.byFormId("nonexistent").get()
} catch (error) {
  if (error instanceof Error) {
    console.error("API error:", error.message)
  }
}

Advanced Usage

For full control over the underlying Kiota client:

import { createFormalingoClient } from "@formalingo/sdk"
import {
  ApiKeyAuthenticationProvider,
  ApiKeyLocation,
} from "@microsoft/kiota-abstractions"
import { FetchRequestAdapter } from "@microsoft/kiota-http-fetchlibrary"

const auth = new ApiKeyAuthenticationProvider(
  "Bearer af_live_YOUR_API_KEY",
  "Authorization",
  ApiKeyLocation.Header
)
const adapter = new FetchRequestAdapter(auth)
adapter.baseUrl = "https://app.formalingo.com"

const rawClient = createFormalingoClient(adapter)
const v1 = rawClient.api.v1

Requirements

  • Node.js 20+
  • ESM (this package uses "type": "module")

Other SDKs

Formalingo also provides SDKs for:

Documentation

Full API documentation and guides: formalingo.com/docs

License

MIT