@vperms/client
v0.0.6
Published
Framework-independent VeguiPerms client for resolved permissions.
Maintainers
Readme
VeguiPerms Client
@vperms/client is the framework-independent VeguiPerms client. Fetch a resolved
subject once, then evaluate permissions synchronously from its immutable snapshot.
Client guide · API reference · GitHub
Install
npm install @vperms/clientQuick start
import { createVPerms } from "@vperms/client";
const perms = createVPerms("https://api.example.com", {
prefix: "/vperms",
fetchOptions: { credentials: "include" },
});
const ability = await perms.getAbility(); // GET /vperms/subject/me
ability.can("projects.1.read"); // synchronous booleanThe server must enable a permission export endpoint.
Use createAbility(resolvedSubject) when you already have a snapshot, or provide
a custom fetch for SSR and credential forwarding.
Client checks support UI decisions; authorize sensitive operations on the server. For component bindings, see VeguiPerms React.
Build and coverage badges describe the whole VeguiPerms repository. License: MIT.
