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

@geekapps/silo-fastify

v0.1.0

Published

Fastify plugin to embed Silo file handling in any Fastify app

Downloads

314

Readme

@geekapps/silo-fastify

Fastify plugin that lets any Fastify app expose presigned-upload routes backed by the central Silo API — no local disk storage. The plugin authenticates to Silo with a service account (OAuth2 client-credentials) and proxies the multipart-upload flow: callers ask for an upload URL, PUT the file bytes directly to storage, then hit the complete route to finalize.

This package is a server plugin, not a client SDK. For browser/Next.js uploads use @geekapps/silo-nextjs instead.

Install

import Fastify from "fastify";
import siloPlugin from "@geekapps/silo-fastify";

const app = Fastify();

await app.register(siloPlugin, {
  apiUrl: "https://api.silo.geekapps.com.br",
  serviceAccount: {
    issuerUrl: "https://api.silo.geekapps.com.br",
    clientId: process.env.SILO_CLIENT_ID!,
    clientSecret: process.env.SILO_CLIENT_SECRET!,
  },
});

Options (SiloPluginOptions)

| Option | Required | Default | Description | | ---------------- | -------- | ----------- | ----------------------------------------------------- | | apiUrl | yes | — | Base URL of the central Silo API | | serviceAccount | yes | — | { issuerUrl, clientId, clientSecret } for OAuth2 client-credentials auth | | defaultBucket | no | "default" | Bucket used when the caller doesn't specify one | | prefix | no | /silo | Route prefix |

Upload flow

  1. POST {prefix}/upload/start — body: { fileName, mimeType, size, bucket?, isPrivate?, expiresIn?, image?, video? }. Starts a multipart upload on the central Silo API and returns a presigned URL for part 1:

    { "fileId": "...", "uploadId": "...", "uploadUrl": "https://..." }

    The caller PUTs the file bytes to uploadUrl directly (bypassing this server) and keeps the returned ETag.

  2. For files split into more than one part, GET {prefix}/upload/:fileId/part?uploadId=&partNumber= returns a presigned URL for any additional part.

  3. POST {prefix}/upload/:fileId/complete — the caller reports completion here once all parts are uploaded. Body: { uploadId, parts: [{ PartNumber, ETag }], image?, video? }. This finalizes the file on Silo and returns the resulting file record.

  4. DELETE {prefix}/upload/:fileId — body: { uploadId }. Aborts an in-progress upload.

Downloads

POST {prefix}/files/:fileId/sign — body: { ttl?, disposition? }. Proxies to the central Silo API's sign endpoint and returns a presigned download URL.

Decorator

fastify.silo.request(path, init?) is available on the Fastify instance to call any other central Silo API route directly, using the same service-account auth as the routes above.

⚠️ No caller authentication

None of the routes authenticate who is calling — they only authenticate this server to the central Silo API via the service account. Anyone who can reach these routes can start/complete uploads and mint signed download URLs. Put your own auth (API gateway, internal network boundary, or a Fastify onRequest hook) in front of this plugin if callers need to be authenticated or scoped.