承接 edgebase/admin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

edgebase/admin

最新稳定版本:v0.2.9

Composer 安装命令:

composer require edgebase/admin

包简介

EdgeBase Admin SDK — server-side admin operations.

README 文档

README

EdgeBase Logo

EdgeBase PHP Admin SDK

Trusted server-side PHP SDK for EdgeBase.

Use edgebase/admin from backend APIs, jobs, workers, and other trusted PHP runtimes that hold a Service Key. It exposes admin auth, database access, raw SQL, storage, push, analytics, functions, and native edge resources.

If you are working inside this repository, AdminEdgeBase exists as a backwards-compatible alias for AdminClient. Prefer AdminClient in new code.

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 a fast overview, then jump into the docs when you need depth:

For AI Coding Assistants

This package includes an llms.txt file for AI-assisted development.

Use it when you want an agent or code assistant to:

  • keep Service Keys on trusted servers
  • use the actual PHP property and method names
  • avoid copying JavaScript promise-based examples into PHP
  • know when to use adminAuth and storage properties versus push(), functions(), and analytics() methods

You can find it:

  • in this repository: llms.txt
  • in your environment after install, inside the EdgeBase\Admin package directory as llms.txt

Installation

composer require edgebase/admin

Quick Start

<?php

use EdgeBase\Admin\AdminClient;

$admin = new AdminClient(
    'https://your-project.edgebase.fun',
    getenv('EDGEBASE_SERVICE_KEY') ?: ''
);

$users = $admin->adminAuth->listUsers(limit: 20);

$postRows = $admin->sql(
    'shared',
    null,
    'SELECT id, title FROM posts WHERE status = ?',
    ['published']
);

$bucket = $admin->storage->bucket('avatars');
$bucket->upload('user-1.jpg', 'binary-data', contentType: 'image/jpeg');

$admin->push()->send('user-1', [
    'title' => 'Deployment finished',
    'body' => 'Your content is live.',
]);

Core API

  • $admin->adminAuth Admin user management client
  • $admin->storage Storage client
  • $admin->db(namespace, instanceId = null) Service-key database access
  • $admin->sql(namespace, id, query, params = []) Raw SQL execution
  • $admin->broadcast(channel, event, payload = []) Server-side database-live broadcast
  • $admin->push() Push notifications
  • $admin->functions() Call app functions from trusted code
  • $admin->analytics() Query analytics and track server-side events
  • $admin->kv(namespace), $admin->d1(database), $admin->vector(index) Native edge resources
  • $admin->destroy() No-op cleanup hook

Database Access

$posts = $admin->db('app')->table('posts');
$rows = $posts->where('status', '==', 'published')->get();

For instance databases, pass the instance ID positionally:

$admin->db('workspace', 'ws-123');
$admin->db('user', 'user-123');

Admin Users

$created = $admin->adminAuth->createUser([
    'email' => 'admin@example.com',
    'password' => 'secure-pass-123',
    'displayName' => 'June',
]);

$admin->adminAuth->setCustomClaims($created['id'], [
    'role' => 'moderator',
]);

$users = $admin->adminAuth->listUsers(limit: 20);

Raw SQL

sql() always takes an explicit namespace and optional instance ID:

$sharedRows = $admin->sql('shared', null, 'SELECT 1 AS ok');

$workspaceRows = $admin->sql(
    'workspace',
    'ws-123',
    'SELECT * FROM documents WHERE status = ?',
    ['published']
);

Push And Analytics

$admin->push()->send('user-123', [
    'title' => 'Hello',
    'body' => 'From the admin SDK',
]);

$overview = $admin->analytics()->overview(['range' => '7d']);

Choose The Right Package

Package Use it for
edgebase/admin Trusted server-side PHP code with Service Key access
edgebase/core Lower-level primitives for custom integrations

License

MIT

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固