Skip to content

feat(notifications): SMS Factor integration - #846

Merged
fclairamb merged 8 commits into
mainfrom
feat/smsfactor-sms
Nov 12, 2026
Merged

fclairamb merged 8 commits into
mainfrom
feat/smsfactor-sms

Conversation

@fclairamb

Copy link
Copy Markdown
Owner

Adds SMS Factor as an SMS provider, following their Go example (POST https://api.smsfactor.com, Bearer token, JSON body sms.message + sms.recipients.gsm, pushtype: alert). Two paths, like Twilio:

Instance provider (server-provided SMS)

  • SP_SMS_PROVIDER=smsfactor, SP_SMS_SMSFACTOR_TOKEN (secret), optional SP_SMS_SENDER (registered alphanumeric sender, 1-11 chars) and SP_SMS_SMSFACTOR_BASE_URL (proxy / tests). Only the token is required for Active(): SMS Factor falls back to the account's default sender.
  • New client server/internal/integrations/smsfactor (standard library only, like twilio and ovhsms): request timeout, HTTP status check, then the body's status field (the API answers 200 with a negative status): -8 (under moderation) counts as accepted and is never retried, sent == 0 with status 1 is an error naming the filter counters (invalid, blacklisted, flood, country limit…). Recipients are sent without the leading +. GET /credits verifies a token.
  • sms.Sender adapter in the provider-neutral seam (NewInstanceSender). No delivery receipts: the campaign body has no per-message callback (documented).

Organization integration (bring your own)

  • Connection type smsfactor, settings token (secret, encrypted and write-only like Twilio's auth_token), sender, to_numbers (E.164). Verified against SMS Factor at creation and when the token changes (skipped in test run mode, like Twilio).
  • Registry sender for direct-channel sends (per-check broadcast, test) fanning out to to_numbers; the SMS bodies are now shared with Twilio (buildSMSBody), the "Reply STOP" footer stays Twilio-only.
  • Resolver: an org with no Twilio connection but an enabled default SMS Factor one pages its users through it (bring_your_own for SMS; voice stays on the instance provider or unavailable). The escalation step no longer requests a Twilio status callback for such sends.
  • Dashboard: SMS Factor in the new-integration list, its form (token, sender, recipient numbers, data-testid on every field), icon, en/fr/de/es translations, and the SMS mode panel / account notifications page count an SMS Factor integration as the org's own SMS. E2E: create an SMS Factor channel via the form.
  • Docs: configuration/sms.md (provider table, instance setup, bring-your-own, troubleshooting) and configuration/notifications.md (channel entry with a JSON example); wiki database model.

No migration (settings are JSON), no OpenAPI change (the connection type is a free-text field), server/pkg/client not regenerated (batch rule).

How to test with a token

  1. Create a token at my.smsfactor.com/developers/api-tokens.
  2. Instance mode: SP_SMS_ENABLED=true SP_SMS_PROVIDER=smsfactor SP_SMS_SMSFACTOR_TOKEN=… SP_SMS_SENDER=acme make dev, then add a phone number on a user and send the verification SMS.
  3. Org mode: Integrations → New → SMS Factor, paste the token, add a recipient number, then "Send test".

🤖 Generated with Claude Code

SMS Factor (smsfactor.com) joins Twilio and OVH as an SMS provider, on both
paths: the instance provider (SP_SMS_PROVIDER=smsfactor, SP_SMS_SMSFACTOR_TOKEN,
optional SP_SMS_SENDER) and a per-organization integration (type smsfactor:
token, sender, to_numbers) that pages the org's users and its shared recipients.
The client follows the provider's Go example: POST https://api.smsfactor.com with
a Bearer token, pushtype alert, recipients without the leading +, the body's
status field checked (-8 under moderation counts as accepted, never retried).
Dashboard form, translations, SMS mode panel, docs and an E2E test included.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.63014% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.37%. Comparing base (1a0cea9) to head (2d088c8).

Files with missing lines Patch % Lines
server/internal/db/models/integration.go 86.66% 2 Missing ⚠️
server/internal/handlers/integrations/service.go 95.91% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #846      +/-   ##
==========================================
+ Coverage   89.29%   89.37%   +0.07%     
==========================================
  Files        1351     1353       +2     
  Lines      138760   139015     +255     
==========================================
+ Hits       123903   124240     +337     
+ Misses      14848    14766      -82     
  Partials        9        9              
Files with missing lines Coverage Δ
server/internal/config/sms.go 100.00% <100.00%> (ø)
server/internal/crypto/credentials/conn_secrets.go 100.00% <ø> (ø)
server/internal/integrations/sms/resolve.go 98.46% <100.00%> (+5.27%) ⬆️
server/internal/integrations/sms/sender.go 91.58% <100.00%> (+1.47%) ⬆️
server/internal/integrations/smsfactor/client.go 100.00% <100.00%> (ø)
server/internal/integrations/twilioconn/resolve.go 100.00% <100.00%> (+29.41%) ⬆️
...rver/internal/jobs/jobtypes/job_escalation_step.go 88.75% <100.00%> (+0.30%) ⬆️
server/internal/notifications/registry.go 95.00% <100.00%> (+0.26%) ⬆️
server/internal/notifications/smsfactor.go 100.00% <100.00%> (ø)
server/internal/notifications/twilio.go 90.80% <100.00%> (+3.74%) ⬆️
... and 2 more

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fclairamb
fclairamb merged commit 1b68d2a into main Nov 12, 2026
36 checks passed
@fclairamb
fclairamb deleted the feat/smsfactor-sms branch November 12, 2026 08:28
fclairamb added a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.48.0](v0.47.0...v0.48.0)
(2026-11-12)


### Features

* lease sizing, Telegram sign-in and four small fixes (2026-11-11
issues) ([#848](#848))
([9972dde](9972dde))
* **notifications:** SMS Factor integration
([#846](#846))
([1b68d2a](1b68d2a))


### Bug Fixes

* **deps:** update github.com/dop251/goja digest to f493a2b
([#842](#842))
([dba208b](dba208b))
* **deps:** update go dependencies (non-major)
([#844](#844))
([621d492](621d492))
* **deps:** update go dependencies (non-major)
([#847](#847))
([4bb06f7](4bb06f7))
* **security:** bind JS env and plugin configs, strict re-wrap keys,
replay masking of remaining secret inputs, rewrap list cap, secret
headers on redirects
([#851](#851))
([32fd560](32fd560))
* **security:** bind sealed secrets to their target, verify peer
re-wraps, drop deleted regions' keys, TLS-only agent server URL
([#840](#840))
([4b70e46](4b70e46))
* **security:** keep shown-once secrets out of dash0 session replay
([#839](#839))
([9bb8e8b](9bb8e8b))
* **security:** require a verified email for GitLab sign-in and stop
linking existing accounts by email
([#850](#850))
([1a0cea9](1a0cea9))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant