import { Cronhost } from 'cronhost';
// Initialize the client
const cronhost = new Cronhost({
apiKey: 'your-api-key-here',
baseUrl: 'https://cronho.st' // Optional, defaults to https://cronho.st
});
// Create a schedule
const schedule = await cronhost.createSchedule({
name: 'Daily Health Check',
description: 'Check if our API is healthy every day at 9 AM',
cronExpression: '0 9 * * *',
timezone: 'America/New_York',
endpoint: 'https://api.example.com/health',
httpMethod: 'GET',
maxRetries: 3,
timeoutSeconds: 30
});
console.log('Schedule created:', schedule);