@edge-base/core
v0.2.6
Published
EdgeBase core SDK — platform-agnostic client for auth, database, storage, and functions
Readme
@edge-base/core is the low-level foundation used by the public EdgeBase SDKs.
Use it when you are:
- building a custom runtime wrapper on top of EdgeBase
- reusing the query builder, storage layer, or HTTP transport in internal tooling
- implementing environment-specific SDK surfaces that should not depend on the browser or admin entry points
If you are building an application, you usually want a higher-level package instead:
@edge-base/webfor browser apps@edge-base/adminfor trusted server-side code@edge-base/react-nativefor React Native apps
EdgeBase is the open-source edge-native BaaS that runs on Edge, Docker, and Node.js.
This package is one part of the wider EdgeBase platform. For the full platform, CLI, Admin Dashboard, server runtime, docs, and all public SDKs, see the main repository: edge-base/edgebase.
Documentation Map
Use this README for the package boundary and shared primitives, then jump into the runtime docs:
- SDK Overview Public package matrix and install entry points
- Client SDK Higher-level browser query patterns built on these primitives
- Admin SDK Reference Trusted-server APIs that reuse the same transport and storage layers
- Database Admin SDK Query, pagination, batch writes, and raw SQL context
- Storage Upload, download, metadata, and signed URL flows
For AI Coding Assistants
This package ships with an llms.txt file for AI-assisted development.
Use it when you want an agent or code assistant to:
- stay on the low-level
@edge-base/coresurface instead of assuming browser or admin entry points - use the real
HttpClient,DbRef,TableRef, andStorageClientAPIs - keep custom wrappers aligned with the generated EdgeBase transports
You can find it:
- in this package after install:
node_modules/@edge-base/core/llms.txt - in the repository: llms.txt
Installation
npm install @edge-base/coreQuick Start
import {
ContextManager,
DbRef,
FunctionsClient,
HttpClient,
StorageClient,
} from '@edge-base/core';
const contextManager = new ContextManager();
const http = new HttpClient({
baseUrl: 'https://your-project.edgebase.fun',
contextManager,
});
const db = new DbRef('app', undefined, http);
const posts = await db.table('posts').limit(10).getList();
const storage = new StorageClient(http);
const bucket = storage.bucket('avatars');
const url = bucket.getUrl('user-1.jpg');
const functions = new FunctionsClient(http);
const health = await functions.get('health');
console.log(posts.items, url, health);Core API
These are the main primitives exported by @edge-base/core:
HttpClientShared authenticated transport with token refresh and service-key supportDbRef,TableRef,DocRefLow-level database query builders and CRUD surfacesStorageClient,StorageBucketShared storage bucket primitivesFunctionsClientFunction invocation helperincrement,deleteFieldField operation helpersContextManagerShared request/user context containerEdgeBaseErrorCommon SDK error type
Choose The Right Package
| Package | Use it for |
| --- | --- |
| @edge-base/core | Custom wrappers, low-level integrations, shared SDK primitives |
| @edge-base/web | Browser and untrusted client apps |
| @edge-base/react-native | React Native apps |
| @edge-base/admin | Trusted server-side code with admin access |
License
MIT
