JSPM

@teamboks/core

0.3.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 158
  • Score
    100M100P100Q92729F
  • License MIT

Teamboks Core SDK - Framework-agnostic permission management

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/core

Usage

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 check
  • action: string - The action to perform
  • role: string - The user's role
  • apiKey?: 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