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

@dofe/file-sdk

v0.1.10

Published

DofeAI unified file management SDK for Node.js — upload, CDN URL resolution, and file metadata via sso.dofe.ai

Readme

@dofe/file-sdk

DofeAI unified file management SDK for Node.js — upload, CDN URL resolution, and file metadata via sso.dofe.ai.

The caller provides business context such as scope, tenantId, and teamId. SSO owns the physical storage route. Do not pass or persist bucket configuration in business services.

Install

pnpm add @dofe/file-sdk

Quick Start

import { FileClient } from '@dofe/file-sdk';

const fileClient = new FileClient({
  baseUrl: 'https://sso.dofe.ai',
  internalSecret: process.env.INTERNAL_API_SECRET,
});

// Get upload token (your app passes this to the browser)
const { token, fileId, cdnUrl } = await fileClient.getUploadToken({
  filename: 'photo.jpg',
  fsize: 2048000,
  scope: 'avatar',
  signature: '<user-signature>',
});

// Upload from a remote URL
const file = await fileClient.uploadFromUrl({
  url: 'https://cdn.example.com/image.png',
  scope: 'media_asset',
});

// Upload in-memory content, useful for server-side artifacts
const artifact = await fileClient.uploadContent({
  content: Buffer.from('{"ok":true}'),
  filename: 'audit.json',
  mimeType: 'application/json',
  scope: 'system',
});

// Get CDN URL (cached for public files)
const url = await fileClient.getCdnUrl(fileId, {
  template: 'thumb',
  width: 200,
  height: 200,
});

// Batch query files
const files = await fileClient.batchGetFiles([id1, id2, id3]);

// Delete a file
await fileClient.deleteFile(fileId);

API Reference

new FileClient(config)

| Option | Type | Required | Default | Description | | ---------------- | -------- | :------: | ------- | --------------------------------------------- | | baseUrl | string | ✅ | — | SSO base URL (e.g., https://sso.dofe.ai) | | internalSecret | string | ✅ | — | INTERNAL_API_SECRET for HMAC-SHA256 signing | | timeout | number | ❌ | 30000 | Request timeout in ms |

Methods

| Method | Returns | Auth | Description | | ----------------------------------- | ----------------------- | :------: | ------------------------------------------------ | | getUploadToken(params) | UploadTokenResponse | Public | Get SSO-issued presigned upload URL | | uploadFromUrl(params) | UploadFromUrlResponse | Internal | Let SSO fetch a remote URL into managed storage | | uploadContent(params) | UploadContentResponse | Internal | Upload server-side Buffer/string content via SSO | | getFileById(id) | FileItem | Internal | Get file metadata | | batchGetFiles(ids) | BatchFileResponse | Internal | Batch get file metadata | | getCdnUrl(id, options?) | string \| null | Internal | Get CDN URL (cached for public files) | | batchResolveCdnUrl(ids, options?) | SignedUrl[] | Internal | Batch get signed CDN URLs | | deleteFile(id) | void | Internal | Soft-delete a file |

Scopes

| Scope | Intended use | Access | URL behavior | | ------------- | --------------------------------- | :-----: | ------------------------------ | | avatar | User avatar | public | Permanent CDN URL when enabled | | logo | Tenant/vendor logo | public | Permanent CDN URL when enabled | | media_asset | Public media assets | public | Permanent CDN URL when enabled | | knowledge | Knowledge-base source files | private | Signed URL | | general | Default private business files | private | Signed URL | | system | Internal artifacts and audit data | private | Signed URL |

bucket, key, vendor, and region may appear in responses as SSO-owned physical metadata. They are read-only integration details and must not be used as configuration in agents/models or other business services.

License

MIT