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

@fjall/payload

v0.96.0

Published

Fjall AWS adapters and utilities for Payload CMS

Readme

@fjall/payload

AWS Lambda adapters for Payload CMS. This package provides drop-in replacements for Payload's database and storage adapters, optimized for serverless deployments on AWS.

Installation

pnpm add @fjall/payload @payloadcms/storage-s3

Features

  • fjallPostgresAdapter - PostgreSQL adapter with AWS Secrets Manager integration
  • awsS3Storage - S3 storage plugin for media uploads
  • fjallDefaults - Sensible CORS/CSRF defaults for Lambda
  • isProduction / isLambda - Environment detection helpers

Usage

Database Adapter

// payload.config.ts
import { buildConfig } from "payload";
import { fjallPostgresAdapter, fjallDefaults } from "@fjall/payload";
import { migrations } from "./migrations";

export default buildConfig({
  ...fjallDefaults(),
  db: await fjallPostgresAdapter({
    migrationDir: "./src/migrations",
    prodMigrations: migrations,
  }),
  // ... rest of config
});

The adapter automatically:

  • Fetches database credentials from AWS Secrets Manager in Lambda
  • Falls back to DATABASE_URL for local development
  • Configures SSL for Aurora PostgreSQL

S3 Storage Plugin

// plugins/index.ts
import { awsS3Storage } from "@fjall/payload";
import { Plugin } from "payload";

export const plugins: Plugin[] = [awsS3Storage()];

The plugin automatically:

  • Uses MEDIA_BUCKET_NAME environment variable set by Fjall infrastructure
  • Handles presigned URLs for uploads
  • Falls back to local filesystem in development

Environment Detection

import { isProduction, isLambda } from "@fjall/payload";

// Conditional logic based on environment
if (isProduction()) {
  // Running in AWS with Fjall infrastructure
}

if (isLambda()) {
  // Running in AWS Lambda runtime
}

Conditional Static Directory

For Media collections that need local uploads in dev but S3 in production:

import { isProduction } from "@fjall/payload";
import path from "path";

export const Media: CollectionConfig = {
  slug: "media",
  upload: {
    ...(isProduction()
      ? {}
      : {
          staticDir: path.resolve(__dirname, "../../public/media"),
        }),
  },
};

Environment Variables

Production (Lambda)

Set automatically by Fjall infrastructure:

| Variable | Description | | ------------------- | ----------------------------- | | DATABASE_HOST | Aurora PostgreSQL endpoint | | DATABASE_PORT | Database port (default: 5432) | | DATABASE_NAME | Database name | | DATABASE_SSL | Enable SSL (true) | | MEDIA_BUCKET_NAME | S3 bucket for uploads |

Credentials fetched from Secrets Manager:

  • DATABASE_USERNAME
  • DATABASE_PASSWORD

Development

| Variable | Description | | -------------- | --------------------------------- | | DATABASE_URL | Full PostgreSQL connection string |

Auto-Configuration

When you run fjall deploy on a Payload project, the CLI automatically:

  1. Detects the Payload pattern
  2. Installs @fjall/payload and @payloadcms/storage-s3
  3. Patches payload.config.ts to use fjallPostgresAdapter
  4. Patches or creates plugins/index.ts with S3 storage
  5. Configures next.config.js for Lambda (standalone output)
  6. Generates open-next.config.ts for OpenNext

No manual configuration required - just run fjall deploy.

Licence

Proprietary — see LICENSE.