|
1 | | -import Honeybadger from '../dist/server/honeybadger' |
| 1 | +import { Defaults } from '@honeybadger-io/core' |
| 2 | +import Honeybadger, { CheckInsClient, CheckIn, ServerTransport } from '../dist/server/honeybadger' |
2 | 3 |
|
3 | 4 | Honeybadger.configure({ |
4 | 5 | debug: false, |
@@ -40,4 +41,33 @@ const client2 = Honeybadger.factory() |
40 | 41 | client2.beforeNotify(() => { |
41 | 42 | console.log('Notifying') |
42 | 43 | }) |
43 | | -client2.notify('test') |
| 44 | +client2.notify('test'); |
| 45 | + |
| 46 | +(async function () { |
| 47 | + const checkInsClient = new CheckInsClient({ |
| 48 | + apiKey: 'project api key', |
| 49 | + appEndpoint: Defaults.CONFIG.appEndpoint, |
| 50 | + personalAuthToken: 'personal auth token', |
| 51 | + logger: console |
| 52 | + }, new ServerTransport()) |
| 53 | + |
| 54 | + await checkInsClient.get('project id', 'check-in id') |
| 55 | + |
| 56 | + await checkInsClient.create('project id', new CheckIn({ |
| 57 | + name: 'a simple check-in', |
| 58 | + slug: 'simple-check-in', |
| 59 | + scheduleType: 'simple', |
| 60 | + reportPeriod: '1 day', |
| 61 | + gracePeriod: '5 minutes', |
| 62 | + })) |
| 63 | + |
| 64 | + await checkInsClient.create('project id', new CheckIn({ |
| 65 | + name: 'a cron check-in', |
| 66 | + slug: 'cron-check-in', |
| 67 | + scheduleType: 'cron', |
| 68 | + cronSchedule: '* * * * 5', |
| 69 | + cronTimezone: 'UTC', |
| 70 | + gracePeriod: '5 minutes', |
| 71 | + })) |
| 72 | +})() |
| 73 | + |
0 commit comments