# @appkit/dek-plugin

The plugin SDK for building DEK plugins. Provides type definitions, the `DekApi` implementation, and React hooks for plugin state.

## Installation

```bash
npm install @appkit/dek-plugin
```

## Usage

```typescript
import { DekApi, DekPlugin, DekPluginComponentItem } from '@appkit/dek-plugin';

class Plugin implements DekPlugin {
  constructor(config: Record<string, string>) {
    this.config = config;
  }

  async load(api: DekApi) {
    api.trace('Plugin loaded');
  }

  async unload() {}

  get components(): DekPluginComponentItem[] {
    return [
      {
        key: 'my-card',
        element: (props: any) => <MyCard {...props} />,
        schema: {
          title: { type: 'string', title: 'Title', default: 'Hello' }
        }
      }
    ];
  }
}

export default Plugin;
```

## Documentation

- [API Reference](docs/api-reference.md) — Full DekPlugin interface, DekApi methods, DekRegistry, schema types
- [Plugin Development Guide](../../docs/plugin-development.md) — Step-by-step guide to building plugins
