Socket
Book a DemoInstallSign in
Socket

browsable-object

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browsable-object

A decorator, inheritance mechanism, and handler for making Cloudflare Durable Objects browsable and queryable via SQL. Forked from [@outerbase/browsable-durable-object](https://github.com/outerbase/browsable-durable-object) to change functionality. See th

0.2.3
latest
npmnpm
Version published
Weekly downloads
6
100%
Maintainers
1
Weekly downloads
 
Created
Source

browsable-object

A decorator, inheritance mechanism, and handler for making Cloudflare Durable Objects browsable and queryable via SQL. Forked from @outerbase/browsable-durable-object to change functionality. See the original for usage patterns.

Added features compared to original:

  • query validation via validator
  • auth is required unless explicitly disabled (more secure, harder to make mistakes!)
  • easy to plug into all your DOs using any chosen routing pattern
  • middleware browsableRequest allows directly plugging this into your worker
  • studio is now directly part of your DO it when @Browsable is used, no need for additional config (works even in localhost!)

Easiest Usage:

@Browsable({
  basicAuth: { username: "admin", password: env.SECRET },
  // dangerouslyDisableAuth: true,
  // disableStudio:true,
  // validator: createReadOnlyValidator(),
})
export class MyDO extends DurableObject {
  //... your DO
}
type Env = { SECRET: string; MyDO: DurableObjectNamespace };
export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const url = new URL(request.url);
    const firstSegment = url.pathname.split("/")[1];
    if (!firstSegment) {
      return new Response(
        `Usage: /{id}/studio for the studio, raw queries at /{id}/query/raw`,
      );
    }
    // Forward the request to the specified durable object
    const stub = env.MyDO.get(env.MyDO.idFromName(firstSegment));
    return stub.fetch(request);
  },
};

Installation

npm install browsable-object

Check https://github.com/outerbase/browsable-durable-object for other usage patterns

TODO

  • Confirm remote-sql-cursor 'exec' function works with the browsableRequest middleware.
  • If so, I can use this in DORM to 1) have easy pattern to make aggregate readonly and 2) make it possible to easily access studio for client with any amount of mirrors.
  • Try with @cloudflare/actors (thread)

FAQs

Package last updated on 09 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.