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 ๐Ÿ™

ยฉ 2024 โ€“ย Pkg Stats / Ryan Hefner

gatsby-source-airtable-next

v4.3.2

Published

Gatsby source plugin for Airtable, build for Gatsby v4 and beyond ๐Ÿš€

Downloads

45

Readme

gatsby-source-airtable-next

Airtable source plugin, built for modern Gatsby sites

NPM Version NPM Downloads NPM License Twitter

How to install

npm install gatsby-source-airtable-next

or

yarn add gatsby-source-airtable-next

How to use

module.exports = {
  plugins: [
    {
      resolve: "gatsby-source-airtable-next",
      options: {
        apiKey: "AIRTABLE_KEY",
        refreshInterval: 60000 * 5, // (5 minutes) optional
        tables: [
          {
            baseId: "AIRTABLE_BASE_ID",
            tableName: "TABLE_NAME",
            tableView: "TABLE_VIEW_NAME", // optional
            recordLinks: [
              {
                fromField: "LINK_TO_ANOTHER_RECORD_FIELD_NAME",
                toTable: "TABLE_NAME_THAT_fromField_LINKS_TO",
              },
            ], // optional
            downloadLocal: ["ATTACHMENT_FIELDS"], // optional
          },
          // can be multiple tables, even from different bases
        ],
      },
    },
  ],
};

Node key naming

During node creation this plugin will convert your Airtable table field names into camel case strings, using Lodash's _.camelCase() method, and use that as the node key.

For example Phone no. (Cell) will become phoneNoCell, Country of origin will become countryOfOrigin, and Package volume (mยณ) will become packageVolumeM.

Refresh interval

options: { refreshInterval?: number } optional

If set, time (in milliseconds) to wait between builds for fetching fresh Airtable data. Default: 0

"Link to another Record" type fields

options: { tables: { recordLinks?: { fromField: string; toTable: string; }[]; } optional

If set enables links to records in other tables. If you wish to query data from a linked record, you must specify the from field name and to table name in recordLinks. If not set this will be an array of Airtable record IDs.

Table views

options: { tables: { tableView?: string }[] } optional

If set, only the records in that view will be returned. The records will be sorted according to the order of the view. Fields hidden in this view will be sourced.

For example, if you are creating a blog or documentation site, specify a published field in Airtable, create a filter showing only published posts, and specify this as the (optional) tableView option in your gatsby-config file.

"Attachment" type fields

options: { tables: { downloadLocal?: string[] }[] } optional

Specifically for image attachment fields. If set will add gatsbyImage to nodes that then can be queried using GraphQL and used with, for example, gatsby-image-plugin.

How does this compare to gatsby-source-airtable?

gatsby-source-airtable is a great source plugin. I both use this plugin and have gotten a lot of inspiration from it. But it hasn't been updated in quite some time. The main differences between this source plugin and gatsby-source-airtable are:

  • Keys are camelCased.
  • Keys are directly on the node and not nested under a data property.
  • Node types are per table, so if you source multiple tables you won't have keys with null data. Since keys are based on each table, they cannot clash with each other.
  • Works with Gatsby Image CDN.

Example

An example site is available in the demo folder.

This site uses this Airtable base and uses the recordLinks option to connect different Airtable tables, and the downloadLocal option to download "Attachment" type fields from Airtable for use with gatsby-image-plugin.

Questions, Feedback, and Suggestions

If you have any questions, feedback or suggestions head on over to discussions.

Found a bug?

If you find a bug please open an issue and/or create a pull request to fix it.