Skip to content

feat(connector): add SMSBao SMS#8871

Merged
wangsijie merged 9 commits into
logto-io:masterfrom
wintbiit:feat-connector-smsbao-sms
May 27, 2026
Merged

feat(connector): add SMSBao SMS#8871
wangsijie merged 9 commits into
logto-io:masterfrom
wintbiit:feat-connector-smsbao-sms

Conversation

@wintbiit
Copy link
Copy Markdown
Contributor

Summary

Add the SMSBao SMS connector for domestic SMS verification flows.

  • Add @logto/connector-smsbao-sms with SMSBao /sms API integration
  • Support configurable SMS templates with Logto payload interpolation
  • Map SMSBao response codes to connector errors
  • Add English and Chinese documentation plus unit tests

Testing

Tested locally
Unit tests

@github-actions github-actions Bot added the feature Cool stuff label May 25, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

COMPARE TO master

Total Size Diff ⚠️ 📈 +30.44 KB

Diff by File
Name Diff
.changeset/add-smsbao-sms-connector.md 📈 +107 Bytes
packages/connectors/connector-smsbao-sms/CHANGELOG.md 📈 +87 Bytes
packages/connectors/connector-smsbao-sms/README.md 📈 +2.05 KB
packages/connectors/connector-smsbao-sms/README.zh-CN.md 📈 +1.93 KB
packages/connectors/connector-smsbao-sms/logo.png ⚠️ 📈 +10.37 KB
packages/connectors/connector-smsbao-sms/package.json 📈 +1.66 KB
packages/connectors/connector-smsbao-sms/src/constant.ts 📈 +2.48 KB
packages/connectors/connector-smsbao-sms/src/index.test.ts 📈 +5.42 KB
packages/connectors/connector-smsbao-sms/src/index.ts 📈 +3.29 KB
packages/connectors/connector-smsbao-sms/src/mock.ts 📈 +869 Bytes
packages/connectors/connector-smsbao-sms/src/types.ts 📈 +460 Bytes
pnpm-lock.yaml 📈 +1.75 KB

@wintbiit wintbiit marked this pull request as ready for review May 25, 2026 17:14
@wintbiit wintbiit requested a review from gao-sun as a code owner May 25, 2026 17:14
Copilot AI review requested due to automatic review settings May 25, 2026 17:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new SMSBao SMS connector package for Logto, including runtime implementation, configuration schema/metadata, docs, and tests.

Changes:

  • Implement SMSBao SMS connector send logic (template selection + API request + error mapping).
  • Add connector metadata/config schema, mock config, docs, and assets.
  • Add Vitest + Nock test coverage for core send scenarios.

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/connectors/connector-smsbao-sms/src/types.ts Introduces Zod config schema for the connector.
packages/connectors/connector-smsbao-sms/src/mock.ts Adds a typed mock config for tests/dev.
packages/connectors/connector-smsbao-sms/src/index.ts Implements connector creation + sendMessage logic and error handling.
packages/connectors/connector-smsbao-sms/src/index.test.ts Adds tests validating successful sends, optional params, and error mapping.
packages/connectors/connector-smsbao-sms/src/constant.ts Defines endpoint + connector metadata and config form defaults.
packages/connectors/connector-smsbao-sms/package.json Registers the new package with dependencies, scripts, and toolchain.
packages/connectors/connector-smsbao-sms/logo.svg Adds connector logo asset.
packages/connectors/connector-smsbao-sms/README.md Adds English connector documentation.
packages/connectors/connector-smsbao-sms/README.zh-CN.md Adds Chinese connector documentation.
packages/connectors/connector-smsbao-sms/CHANGELOG.md Adds initial changelog entry for v1.0.0.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/connectors/connector-smsbao-sms/src/index.test.ts Outdated
Comment thread packages/connectors/connector-smsbao-sms/src/types.ts Outdated
Comment thread packages/connectors/connector-smsbao-sms/src/constant.ts Outdated
Comment thread packages/connectors/connector-smsbao-sms/src/constant.ts Outdated
Comment thread packages/connectors/connector-smsbao-sms/README.md Outdated
@github-actions github-actions Bot added size/xl and removed size/xl labels May 25, 2026
Copilot AI review requested due to automatic review settings May 25, 2026 17:21
@github-actions github-actions Bot added size/xl and removed size/xl labels May 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 11 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread packages/connectors/connector-smsbao-sms/src/index.ts Outdated
Comment thread packages/connectors/connector-smsbao-sms/src/constant.ts
Comment thread packages/connectors/connector-smsbao-sms/src/index.ts Outdated
Comment thread packages/connectors/connector-smsbao-sms/src/index.ts
@github-actions github-actions Bot added size/xl and removed size/xl labels May 25, 2026
@simeng-li simeng-li requested a review from wangsijie May 26, 2026 04:00
Copilot AI review requested due to automatic review settings May 26, 2026 06:26
@github-actions github-actions Bot added size/xl and removed size/xl labels May 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread packages/connectors/connector-smsbao-sms/src/index.ts
Comment thread packages/connectors/connector-smsbao-sms/src/index.ts
Comment thread packages/connectors/connector-smsbao-sms/src/constant.ts
Comment thread packages/connectors/connector-smsbao-sms/README.md Outdated
Comment thread packages/connectors/connector-smsbao-sms/README.md Outdated
@github-actions github-actions Bot added size/xl and removed size/xl labels May 26, 2026
@wintbiit
Copy link
Copy Markdown
Contributor Author

failure of checks is not caused by code involved in this PR.

Copilot AI review requested due to automatic review settings May 27, 2026 01:29
@cursor cursor Bot force-pushed the feat-connector-smsbao-sms branch from 5729e9e to da5367f Compare May 27, 2026 01:29
@github-actions github-actions Bot added size/xl and removed size/xl labels May 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread packages/connectors/connector-smsbao-sms/src/constant.ts
Comment thread packages/connectors/connector-smsbao-sms/src/constant.ts
Comment thread packages/connectors/connector-smsbao-sms/src/index.ts
Comment thread packages/connectors/connector-smsbao-sms/src/index.ts
- Ship logo.png in published package files
- Mask API key field with isConfidential
- Parse config via Zod safeParse for validated output
- Add request timeout and keep retry disabled

Co-authored-by: wangsijie <sijiewg@gmail.com>
@github-actions github-actions Bot added size/xl and removed size/xl labels May 27, 2026
Co-authored-by: wangsijie <sijiewg@gmail.com>
Copilot AI review requested due to automatic review settings May 27, 2026 02:13
@github-actions github-actions Bot added size/xl and removed size/xl labels May 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment thread packages/connectors/connector-smsbao-sms/src/types.ts Outdated
Comment thread packages/connectors/connector-smsbao-sms/src/index.test.ts Outdated
Comment thread packages/connectors/connector-smsbao-sms/README.md Outdated
- Reject empty credentials, templates, and optional product ID in config guard
- Use vi.restoreAllMocks() and reset getConfig mock between tests
- Link Chinese README with a relative path
@github-actions github-actions Bot added size/xl and removed size/xl labels May 27, 2026
@wangsijie wangsijie merged commit 92d9f0b into logto-io:master May 27, 2026
40 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

5 participants