{"id":18668,"library":"plywood-base-api","title":"Plywood Base API","description":"Plywood Base API (v0.2.9) provides foundational TypeScript types and interfaces for implementing requesters in the Plywood ecosystem. It defines the contract that all Plywood requesters must conform to, ensuring consistency across different implementations. The library is dependency-light (only requires 'plywood' as a peer) and ships TypeScript declarations. It is released irregularly alongside Plywood changes.","status":"active","version":"0.2.9","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/implydata/plywood-base-api","tags":["javascript","plywood","requester","api","typescript"],"install":[{"cmd":"npm install plywood-base-api","lang":"bash","label":"npm"},{"cmd":"yarn add plywood-base-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add plywood-base-api","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency – required for types and runtime compatibility","package":"plywood","optional":false}],"imports":[{"note":"Default export is not provided. Use named import for TypeScript or CommonJS.","wrong":"const PlywoodBaseAPI = require('plywood-base-api').PlywoodBaseAPI","symbol":"PlywoodBaseAPI","correct":"import { PlywoodBaseAPI } from 'plywood-base-api'"},{"note":"In TypeScript, prefer 'import type' for type-only imports to avoid runtime costs; however, it ships as a value in CJS, so the wrong form also works but is less efficient.","wrong":"import { RequesterInterface } from 'plywood-base-api'","symbol":"RequesterInterface","correct":"import type { RequesterInterface } from 'plywood-base-api'"},{"note":"Correct for both ESM and CJS; named import is preferred.","wrong":"const BaseRequester = require('plywood-base-api').BaseRequester","symbol":"BaseRequester","correct":"import { BaseRequester } from 'plywood-base-api'"}],"quickstart":{"code":"import { BaseRequester } from 'plywood-base-api';\n\nclass MyRequester extends BaseRequester {\n  constructor() {\n    super();\n  }\n\n  async request(query: string): Promise<any> {\n    // Implement your request logic here\n    return { data: 'result' };\n  }\n}\n\nconst requester = new MyRequester();\nrequester.request('SELECT * FROM table').then(console.log);","lang":"typescript","description":"Shows how to subclass BaseRequester to create a custom Plywood requester with a request method."},"warnings":[{"fix":"Update constructor calls to pass an options object.","message":"Constructor signature change in v0.3.0: constructors now accept an options object instead of individual parameters.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Move initialization logic to constructor.","message":"The 'init' method is deprecated; use constructor for initialization.","severity":"deprecated","affected_versions":">=0.2.5"},{"fix":"Add 'plywood' to your project's dependencies.","message":"TypeScript users must ensure 'plywood' is installed as a peer dependency even if not directly imported.","severity":"gotcha","affected_versions":">=0.2.0"},{"fix":"For Node.js ESM, use 'import { ... } from 'plywood-base-api'; for CJS, use 'const { ... } = require('plywood-base-api');'. Avoid mixing.","message":"ESM and CJS builds are separate; import paths differ between bundlers and Node.js.","severity":"gotcha","affected_versions":">=0.2.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install plywood' in your project.","cause":"Missing peer dependency 'plywood'","error":"Cannot find module 'plywood'"},{"fix":"Ensure 'plywood-base-api' and 'plywood' are installed and loaded correctly; try using dynamic import.","cause":"The import of BaseRequester failed, likely due to circular dependency or bundler issue.","error":"TypeError: Class extends value undefined is not a constructor or null"},{"fix":"Run 'npm install plywood-base-api'.","cause":"Package not installed or not in node_modules.","error":"Module not found: Error: Can't resolve 'plywood-base-api'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}