Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
26 changes: 26 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Security Audit

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * 1"

jobs:
codeql:
runs-on: ubuntu-latest
permissions:
security-events: write

steps:
- uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ruby

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Gemfile.lock
*.swo
*~

# Claude / AI
# Local config
.claude/
CLAUDE.md

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Thank you for your interest in contributing to the kwtsms Ruby gem.

4. Run integration tests (requires API credentials):
```bash
RUBY_USERNAME=your_user RUBY_PASSWORD=your_pass bundle exec rake test_integration
RUBY_USERNAME=ruby_username RUBY_PASSWORD=ruby_password bundle exec rake test_integration
```

## Branch Naming
Expand Down
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
# kwtsms
# kwtSMS Ruby Client

[![Gem Version](https://badge.fury.io/rb/kwtsms.svg)](https://rubygems.org/gems/kwtsms)
[![CI](https://github.com/boxlinknet/kwtsms-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/boxlinknet/kwtsms-ruby/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Ruby](https://img.shields.io/badge/ruby-%3E%3D%202.7-red.svg)](https://www.ruby-lang.org/)
[![Security Audit](https://github.com/boxlinknet/kwtsms-ruby/actions/workflows/codeql.yml/badge.svg)](https://github.com/boxlinknet/kwtsms-ruby/actions/workflows/codeql.yml)
[![Ruby](https://img.shields.io/badge/Ruby-%3E%3D%202.7-red.svg)](https://www.ruby-lang.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

Official Ruby client library for the [kwtSMS](https://www.kwtsms.com) SMS gateway. Send SMS, check balance, validate phone numbers, check delivery status, and manage sender IDs.
Ruby client for the [kwtSMS API](https://www.kwtsms.com). Send SMS, check balance, validate numbers, list sender IDs, check coverage, get delivery reports.

Zero external runtime dependencies. Uses Ruby standard library only.
## About kwtSMS

kwtSMS is a Kuwaiti SMS gateway trusted by top businesses to deliver messages anywhere in the world, with private Sender ID, free API testing, non-expiring credits, and competitive flat-rate pricing. Secure, simple to integrate, built to last. Open a free account in under 1 minute, no paperwork or payment required. [Click here to get started](https://www.kwtsms.com/signup/)

## Prerequisites

You need **Ruby** (>= 2.7) installed.

### Check if Ruby is installed

```bash
ruby -v
```

If not installed, see [ruby-lang.org/en/downloads](https://www.ruby-lang.org/en/downloads/).

## Install

Expand Down Expand Up @@ -44,8 +59,8 @@ puts "msg-id: #{result['msg-id']}" if result["result"] == "OK"
Create a `.env` file or set environment variables:

```ini
KWTSMS_USERNAME=your_api_user
KWTSMS_PASSWORD=your_api_pass
KWTSMS_USERNAME=ruby_username
KWTSMS_PASSWORD=ruby_password
KWTSMS_SENDER_ID=YOUR-SENDER
KWTSMS_TEST_MODE=1
KWTSMS_LOG_FILE=kwtsms.log
Expand All @@ -55,8 +70,8 @@ KWTSMS_LOG_FILE=kwtsms.log

```ruby
sms = KwtSMS::Client.new(
"your_api_user",
"your_api_pass",
"ruby_username",
"ruby_password",
sender_id: "YOUR-SENDER",
test_mode: true,
log_file: "kwtsms.log"
Expand Down Expand Up @@ -315,7 +330,7 @@ Before going live:
Every API call is logged to a JSONL file (default: `kwtsms.log`):

```json
{"ts":"2026-03-06T12:00:00Z","endpoint":"send","request":{"username":"user","password":"***","mobile":"96598765432","message":"Hello"},"response":{"result":"OK","msg-id":"12345"},"ok":true,"error":null}
{"ts":"2026-03-06T12:00:00Z","endpoint":"send","request":{"username":"ruby_username","password":"***","mobile":"96598765432","message":"Hello"},"response":{"result":"OK","msg-id":"12345"},"ok":true,"error":null}
```

Passwords are always masked as `***`. Logging never crashes the main flow.
Expand Down
4 changes: 2 additions & 2 deletions examples/01_basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ gem install kwtsms
Create a `.env` file with your credentials:

```ini
KWTSMS_USERNAME=your_api_user
KWTSMS_PASSWORD=your_api_pass
KWTSMS_USERNAME=ruby_username
KWTSMS_PASSWORD=ruby_password
KWTSMS_SENDER_ID=YOUR-SENDER
KWTSMS_TEST_MODE=1
```
Expand Down
4 changes: 2 additions & 2 deletions examples/01_basic_usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# gem install kwtsms
#
# Create a .env file:
# KWTSMS_USERNAME=your_api_user
# KWTSMS_PASSWORD=your_api_pass
# KWTSMS_USERNAME=ruby_username
# KWTSMS_PASSWORD=ruby_password
# KWTSMS_SENDER_ID=YOUR-SENDER
# KWTSMS_TEST_MODE=1

Expand Down
4 changes: 2 additions & 2 deletions examples/04_rails_endpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Demonstrates integrating kwtsms into a Ruby on Rails application.

3. Set environment variables (or use `.env` in development):
```ini
KWTSMS_USERNAME=your_api_user
KWTSMS_PASSWORD=your_api_pass
KWTSMS_USERNAME=ruby_username
KWTSMS_PASSWORD=ruby_password
KWTSMS_SENDER_ID=YOUR-SENDER
KWTSMS_TEST_MODE=0
```
Expand Down
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

2. Create a `.env` file:
```ini
KWTSMS_USERNAME=your_api_user
KWTSMS_PASSWORD=your_api_pass
KWTSMS_USERNAME=ruby_username
KWTSMS_PASSWORD=ruby_password
KWTSMS_SENDER_ID=YOUR-SENDER
KWTSMS_TEST_MODE=1
```
Expand Down
6 changes: 3 additions & 3 deletions test/test_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ def teardown
end

def test_from_env_with_env_vars
ENV["KWTSMS_USERNAME"] = "testuser"
ENV["KWTSMS_PASSWORD"] = "testpass"
ENV["KWTSMS_USERNAME"] = "ruby_username"
ENV["KWTSMS_PASSWORD"] = "ruby_password"
ENV["KWTSMS_SENDER_ID"] = "MY-SENDER"
ENV["KWTSMS_TEST_MODE"] = "1"

client = KwtSMS::Client.from_env
assert_equal "testuser", client.username
assert_equal "ruby_username", client.username
assert_equal "MY-SENDER", client.sender_id
assert client.test_mode
end
Expand Down