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

@common-grants/cg-grants-gov

v0.1.0

Published

A CommonGrants adapter library for the Simpler.Grants.gov API

Readme

@common-grants/cg-grants-gov

A CommonGrants plugin that defines Grants.gov-specific extensions for the @common-grants/sdk. Use this plugin to work with grant opportunities from the Simpler.Grants.gov API with full type safety and validation.

Table of contents

Overview

The CommonGrants SDK defines a base schema for grant opportunities that works across any grants system. However, individual systems like Grants.gov include additional fields that aren't part of the base schema -- things like agency info, assistance listings, and federal opportunity numbers.

This plugin registers those Grants.gov-specific fields as typed extensions so you can access them alongside the standard CommonGrants fields with full type safety and runtime validation.

To learn more about the CommonGrants extension system, see:

Installation

Install the plugin alongside the CommonGrants SDK:

pnpm add @common-grants/cg-grants-gov @common-grants/sdk

[!NOTE] @common-grants/sdk is a peer dependency. You must install it separately.

Usage

Parsing API responses

Use the plugin's built-in schema with the SDK client to get typed access to Grants.gov-specific fields when fetching opportunities:

import { Client, Auth } from "@common-grants/sdk/client";
import grantsGovPlugin from "@common-grants/cg-grants-gov";

// Create a client pointed at the Simpler.Grants.gov API
const client = new Client({
  baseUrl: "https://api.simpler.grants.gov",
  auth: Auth.apiKey("your-api-key"),
});

// Use the plugin's schema to parse Grants.gov custom fields
const schema = grantsGovPlugin.schemas.Opportunity;

// Fetch a single opportunity with typed custom fields
const opportunity = await client.opportunities.get(opportunityId, { schema });
console.log(opportunity.title);
console.log(opportunity.customFields?.agency?.value);
console.log(opportunity.customFields?.federalOpportunityNumber?.value);

// List and search also accept the schema option
const results = await client.opportunities.search({
  query: "education",
  schema,
});

Combining with other plugins

If you need to add your own custom fields alongside the Grants.gov extensions, use mergeExtensions() and definePlugin() to combine them:

import { definePlugin, mergeExtensions } from "@common-grants/sdk/extensions";
import grantsGovPlugin from "@common-grants/cg-grants-gov";

// Define a local plugin with your own custom fields
const localPlugin = definePlugin({
  extensions: {
    Opportunity: {
      internalNotes: {
        fieldType: "string",
        description: "Internal notes about this opportunity",
      },
      priority: {
        fieldType: "integer",
        description: "Internal priority ranking",
      },
    },
  },
} as const);

// Merge the Grants.gov extensions with your local extensions
const merged = mergeExtensions([grantsGovPlugin.extensions, localPlugin.extensions]);
const combinedPlugin = definePlugin({ extensions: merged });

// Use the combined schema -- both Grants.gov and local fields are typed
const schema = combinedPlugin.schemas.Opportunity;
const opportunity = await client.opportunities.get(id, { schema });
console.log(opportunity.customFields?.agency?.value);
console.log(opportunity.customFields?.internalNotes?.value);

Available custom fields

This plugin extends the Opportunity schema with Grants.gov-specific fields such as agency details, assistance listings, attachments, contact info, and more. For the full list of extensions and their types, see the plugin definition in src/index.ts.

License

CC0-1.0