Package Exports
- @teamboks/core
- @teamboks/core/dist/index.esm.js
- @teamboks/core/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@teamboks/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@teamboks/core
Framework-agnostic core SDK for Teamboks.
Overview
This package contains the shared business logic, API communication, constants, and types that are used across all Teamboks framework-specific SDKs (React, Vue, Angular, Svelte, etc.).
Features
- ✅ Framework-agnostic
- ✅ API key management
- ✅ TypeScript support
- ✅ Shared constants and configuration
Installation
npm install @teamboks/core
# or
pnpm add @teamboks/core
# or
yarn add @teamboks/coreUsage
Basic Setup
import { init, permissions } from '@teamboks/core';
// Initialize with your API key
init('your-api-key-here');
// Check permissions
const result = await permissions.check({
feature: 'dashboard',
action: 'read',
role: 'admin',
});
console.log('Permission status:', result.status);API Reference
init(apiKey: string)
Initialize the SDK with your API key.
permissions.check(params: PermissionCheckParams)
Check if a permission is granted.
Parameters:
feature: string- The feature to checkaction: string- The action to performrole: string- The user's roleapiKey?: string- Optional API key override
Returns: Promise<PermissionCheckResponse>
Types
import type { PermissionCheckParams, PermissionCheckResponse } from '@teamboks/core';Framework-Specific Packages
This core package is used by:
@teamboks/react- React hooks and components@teamboks/vue- Vue composables and components@teamboks/angular- Angular services and directives@teamboks/svelte- Svelte stores and components
License
MIT