open-index/open-npm huggingface dataset:
npm package: @skyiro/notifier-client
Description: gRPC client wrappers for the notifier service
Latest version: 0.1.3

# @skyiro/notifier-client

TypeScript gRPC client for publishing notifier events.

## Install

```bash
pnpm add @skyiro/notifier-client
```

## Usage

```ts
import { NotifierClient } from '@skyiro/notifier-client';

const client = new NotifierClient(process.env.MAILER_GRPC_ADDRESS ?? '127.0.0.1:50051');

async function sendLoginOtp() {
  const response = await client.publishEmailEvent({
    tenantId: 'demo-tenant',
    recipient: 'you@example.com',
    templateKey: 'LOGIN',
    payload: { otp: '123456' },
    idempotencyKey: `login-otp-${Date.now()}`
  });

  console.log(response);
  client.close();
}
```

## Available APIs

- `publishEmailEvent(data)`
- `publishNotificationEvent(data)`
- `close()`

## Configuration

Only one runtime value is configurable: the gRPC server URL/address passed to `NotifierClient`.

```ts
new NotifierClient('127.0.0.1:50051');
```

Recommended environment variable:

- `MAILER_GRPC_ADDRESS` (example: `127.0.0.1:50051`)

There are no additional client options (no auth, retry, timeout, or TLS config exposed by this package yet).

## Local example script

From this package:

```bash
pnpm example:login-email
```