Documentation
Everything you need to integrate console.text() in 30 seconds.
On this page
Quick Start
Get your first SMS alert working in 30 seconds.
1. Get your API key
Visit the homepage and enter your email and phone number to generate your API keys instantly.
2. Install the package
npm install @holler2660/console-text
3. Initialize and use
✅ That's it! You'll receive an SMS within 5-10 seconds.
API Reference
init(config)
Initialize the console.text() SDK. Call this once at the start of your application.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes |
Your API key (ct_live_*
or
ct_test_*)
|
| timeout | number | No | Request timeout in milliseconds (default: 5000) |
| retries | number | No | Number of retry attempts (default: 2) |
| debug | boolean | No | Enable debug logging (default: false) |
Example
console.text(message, options?)
Send an SMS alert. Available after calling
init().
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | Alert message (max 500 characters, auto-truncated) |
| options | object | No | Additional metadata and severity |
| └ metadata | object | No | Custom data to attach to alert |
| └ severity | 'info' | 'warning' | 'critical' | No | Alert severity level |
Examples
🔑 Test vs Live Keys
ct_test_*
Logs to console only,
no SMS sent
ct_live_*
Sends real SMS to
your phone
Usage Examples
Express.js API
Next.js API Route
Cron Job
Deployment Script
Serverless Function (Vercel)
💡 Best Practice: Environment Variables
Never hardcode your API key! Use environment variables:
Rate Limiting
console.text() automatically prevents spam with built-in rate limiting.
How it works
- • Same message within 5 minutes = sent only once
- • Different messages = each one sends
- • Rate-limited messages are logged but not sent
Bypassing Rate Limits
If you need to send the same message multiple times, add a timestamp or unique ID:
Troubleshooting
SMS not received?
-
✓
Check you're using a
ct_live_*key (notct_test_*) - ✓ Verify your phone number is correct in your account
- ✓ Wait 5-10 seconds (delivery isn't instant)
- ✓ Check if message was rate-limited (same message within 5 min)
Getting API errors?
-
✓
Enable debug mode:
init({ debug: true }) -
✓
Check your API key format (must start with
ct_live_orct_test_) -
✓
Verify you called
init()beforeconsole.text()
Network timeouts?
Increase timeout and retries:
Alerts failing silently?
This is by design! Alerting should never crash your app. To debug:
Need help?
Can't find what you're looking for? We're here to help!