CLI & SDK
SDK
Send pushes from your own code with the ZephHook client.
ZephHook is the programmatic half of @zeph-to/cli. It uses native fetch and has no runtime
dependencies.
import { ZephHook } from '@zeph-to/cli';
const hook = new ZephHook({ apiKey: 'ak_...' });
// Notify
const result = await hook.notify({
title: 'Build Complete',
body: 'Deploy succeeded',
url: 'https://example.com/deploy/123',
priority: 'high',
});
console.log(result.pushId); // 'push_01JXY...'
// List
const list = await hook.list({ limit: 5 });
console.log(list.pushes);
// Dismiss
await hook.dismiss('push_01JXY...');
await hook.dismissAll();Constructor options
| Field | Type | Description |
|---|---|---|
apiKey | string | Required. API key from Zeph settings |
baseUrl | string? | API base URL (default: https://api.zeph.to/v1) |
timeout | number? | Request timeout in milliseconds (default: 30000) |
Notify payload
| Field | Type | Description |
|---|---|---|
title | string? | Push title |
body | string? | Push body |
url | string? | URL to include |
type | 'note' | 'link' | 'file' | 'hook'? | Push type (default: hook) |
priority | 'low' | 'normal' | 'high' | 'urgent'? | Priority (default: normal) |
targetDeviceId | string? | Send to a specific device |
Error handling
import { ZephHook, AuthenticationError, QuotaExceededError, ZephError } from '@zeph-to/cli';
try {
await hook.notify({ title: 'Hello' });
} catch (err) {
if (err instanceof AuthenticationError) { /* Invalid API key */ }
if (err instanceof QuotaExceededError) { /* Monthly limit reached */ }
if (err instanceof ZephError) { /* Other API error */ }
}