dev.edgebase.admin
0.2.7
See the version list below for details.
dotnet add package dev.edgebase.admin --version 0.2.7
NuGet\Install-Package dev.edgebase.admin -Version 0.2.7
<PackageReference Include="dev.edgebase.admin" Version="0.2.7" />
<PackageVersion Include="dev.edgebase.admin" Version="0.2.7" />
<PackageReference Include="dev.edgebase.admin" />
paket add dev.edgebase.admin --version 0.2.7
#r "nuget: dev.edgebase.admin, 0.2.7"
#:package dev.edgebase.admin@0.2.7
#addin nuget:?package=dev.edgebase.admin&version=0.2.7
#tool nuget:?package=dev.edgebase.admin&version=0.2.7
<p align="center"> <a href="https://github.com/edge-base/edgebase"> <img src="https://raw.githubusercontent.com/edge-base/edgebase/main/docs/static/img/logo-icon.svg" alt="EdgeBase Logo" width="72" /> </a> </p>
EdgeBase.Admin
Trusted server-side .NET SDK for EdgeBase.
Use EdgeBase.Admin from backend APIs, jobs, workers, and other trusted environments that hold a Service Key. It exposes admin auth, service-key database access, raw SQL, storage, push, functions, analytics, KV, D1, and Vectorize clients.
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 fast overview, then jump into the docs when you need depth:
- SDK Overview Install commands and language matrix for all public SDKs
- Admin SDK Service-key concepts, trust boundaries, and admin-only capabilities
- Admin SDK Reference Cross-language auth, database, storage, functions, push, and analytics examples
- Admin User Management Create, update, delete, and manage users with the Service Key
- Database Admin SDK Table queries, filters, pagination, batch writes, and raw SQL
- Storage Uploads, downloads, metadata, and signed URLs
- Push Admin SDK Push send, topic broadcast, token inspection, and logs
- Analytics Admin SDK Request metrics, event tracking, and event queries
- Native Resources KV, D1, Vectorize, and other edge-native resources
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 Key logic on the server
- use
AdminAuth, notadminAuth - use the real C#
SqlAsync(namespaceName, query, parameters?)signature - remember that
namespaceNamemay encode an instance id asnamespace:id - avoid copying JavaScript or Dart admin API shapes into C#
You can find it:
- in this repository: llms.txt
- in the packed NuGet artifact alongside the package contents
Installation
If you are working inside this repository, reference the project directly:
<ItemGroup>
<ProjectReference Include="..\packages\sdk\csharp\packages\admin\EdgeBase.Admin.csproj" />
</ItemGroup>
The NuGet package id declared by the project is dev.edgebase.admin.
Quick Start
using EdgeBase.Admin;
var serviceKey = Environment.GetEnvironmentVariable("EDGEBASE_SERVICE_KEY")!;
using var admin = new AdminClient("https://your-project.edgebase.fun", serviceKey);
var users = await admin.AdminAuth.ListUsersAsync(limit: 20);
var created = await admin.AdminAuth.CreateUserAsync(
"admin@example.com",
"secure-pass-123",
displayName: "June",
role: "moderator"
);
var rows = await admin.SqlAsync("shared", "SELECT 1 AS ok");
await admin.BroadcastAsync("chat", "message", new { text = "hello" });
Console.WriteLine(users.Users.Count);
Console.WriteLine(created["id"]);
Console.WriteLine(rows.Count);
Core API
Once you create an admin client, these are the main surfaces you will use:
new AdminClient(url, serviceKey)Main server-side entry pointadmin.AdminAuthAdmin user managementadmin.StorageServer-side storage accessadmin.PushSend push notificationsadmin.FunctionsCall app functions from trusted codeadmin.AnalyticsQuery analytics and track server-side eventsadmin.Db(namespace, instanceId?)Service-key database accessadmin.SqlAsync(namespaceName, query, parameters?)Raw SQL executionadmin.BroadcastAsync(channel, eventName, payload?)Server-side database-live broadcastadmin.Kv(namespace),admin.D1(database),admin.Vector(index)Access platform resources from trusted code
Database Access
using EdgeBase.Admin;
using var admin = new AdminClient(baseUrl, serviceKey);
var posts = admin.Db("app").Table("posts");
var result = await posts.GetListAsync();
For instance databases, pass the instance id explicitly:
admin.Db("workspace", "ws-123");
admin.Db("user", "user-123");
For raw SQL, the namespace name can also encode an instance id:
var rows = await admin.SqlAsync("workspace:ws-123", "SELECT * FROM documents");
Read more: Database Admin SDK
Admin Auth
var created = await admin.AdminAuth.CreateUserAsync(
"june@example.com",
"secure-pass-123",
displayName: "June"
);
await admin.AdminAuth.SetCustomClaimsAsync(
created["id"]!.ToString()!,
new Dictionary<string, object?> { ["role"] = "moderator" }
);
var usersPage = await admin.AdminAuth.ListUsersAsync(limit: 20);
Console.WriteLine(usersPage.Users.Count);
Read more: Admin User Management
Raw SQL
SqlAsync supports the C# signature that ships in the package:
await admin.SqlAsync("shared", "SELECT 1 AS ok");
await admin.SqlAsync(
"workspace:ws-123",
"SELECT * FROM documents WHERE status = ?",
new object[] { "published" }
);
Push And Analytics
await admin.BroadcastAsync("announcements", "system:update", new { status = "deployed" });
var overview = await admin.Analytics.OverviewAsync(new Dictionary<string, string> { ["range"] = "7d" });
Console.WriteLine(overview);
Read more:
Native Resource Access
await admin.Kv("cache").SetAsync("homepage", "warm", ttl: 60);
var rows = await admin.D1("analytics").ExecAsync(
"SELECT * FROM events WHERE type = ?",
new object[] { "click" }
);
Console.WriteLine(rows.Count);
Choose The Right Package
| Package | Use it for |
|---|---|
EdgeBase.Admin |
Trusted server-side code with Service Key access |
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- dev.edgebase.core (>= 0.2.7)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.