npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@logto/connector-tencent-sms

v1.2.0

Published

Tencent SMS connector implementation.

Downloads

294

Readme

Tencent short message service connector

The official Logto connector for Tencent short message service.

腾讯云短信服务 Logto 官方连接器 中文文档

Table of contents

腾讯云短信连接器

腾讯云是亚洲地区一个重要的云服务厂商,提供了包括短信服务在内的诸多云服务。

本连接器是 Logto 官方提供的腾讯云短信连接器,帮助终端用户通过短信验证码进行登录注册。

在腾讯云短信服务控制台中配置一个短信服务

💡 Tip

你可以跳过已经完成的部分。

创建腾讯云账号

前往 腾讯云 并完成账号注册。

启用并配置腾讯云短信服务

  1. 用刚刚在 腾讯云 注册的账号登录并前往 短信服务控制台
  2. 点按短信服务页面左上角的「免费试用」按钮并开始配置的流程。
  3. 阅读并同意「短信服务开通条款」和「开通服务」以继续。
  4. 你现在处于「短信服务控制台概览」,根据你的用户场景,点击侧边栏中的「国内消息」或者「国际/港澳台消息」。
  5. 跟随指引添加签名和模板,并提供相应的材料和信息以便审核:
    • 注意:添加 签名 时要在「适用场景」栏选择「验证码」,添加 模板 时「模板类型」也要选择「验证码」,因为我们使用这些签名和模板的目的就是发送验证码。目前暂不支持除发送验证码之外的其它类型文字短信。
    • 请同时注意要在模板的内容中加上 {1} 的占位符,其在实际发出的短信中会被随机生成的验证码所替代。
    • 目前不支持 多个 占位符,请选择或创建仅有一个占位符的模板。
  6. 提交了短信签名和模板的申请之后,需要等待它们生效。这时候我们可以回到 短信服务控制台概览 发送测试短信。如果你的签名和模板都已经通过审核,你可以直接使用它们测试;如果它们还没有通过审核,腾讯云也提供了测试模板供使用。
    • 在发送测试短信之前,你可能需要对账户进行小额的充值。
    • 需要在测试前提前绑定测试所使用的手机号码以便成功收取测试短信。点击 短信服务控制台概览 顶部栏目中的「新手配置指引」标签页以了解更多。

编写连接器的 JSON

  1. 前往 短信服务控制台概览 ,将鼠标悬停在页面右上角的头像处,进入「访问管理」并点按左侧「访问密钥」以及 「API 密钥 」。完成了安全验证之后,你会得到一对「AccessKey ID」和「AccessKey Secret」,请妥善保管它们。
  2. 前往你之前访问过的「国内消息」或「国际/港澳台消息」标签页,可以很快找到「签名名称」和「模板 CODE」。
    • 如果你想使用测试专用的签名模板, 则前往「快速开始」标签页,你就能在「测试专用签名模版」下方找到它们。
  3. 完成腾讯云短信服务连接器的设置:
    • 用你在步骤 1 中拿到的一对「AccessKey ID」和「AccessKey Secret」来分别填入 accessKeyIdaccessKeySecret
    • 用你在步骤 2 中拿到的「签名名称」填入 signName 栏。所有的模板都会共用这个签名。
    • 你可以添加多个短信服务模板以应对不同的用户场景。这里展示填写单个模板的例子:
      • templateCode 栏是你可以用来控制所发送短信内容的属性。它们的值从步骤 2 中的「模板 CODE」获取。
      • usageType 栏填写 RegisterSignInForgotPassword 或者 Generic 其中之一以分别对应 注册登录忘记密码通用 的不同场景。(usageType 是 Logto 的属性,用来确定使用场景。)为了能够使用完成的流程,需要配置 usageTypeRegisterSignIn, ForgotPassword 以及 Generic 的模板。
    • 应用管理 获取应用 ID 填写入 sdkAppId 栏。
    • 发送文档 可以获取短信产品支持的地域,填写入 region 栏。

测试腾讯云短信连接器

你可以在「保存并完成」之前输入一个手机号码并点按「发送」来测试配置是否可以正常工作。

大功告成!快去 启用短信或邮件验证码登录 吧。

配置类型

| 名称 | 类型 | |-----------------|------------| | accessKeyId | string | | accessKeySecret | string | | signName | string | | region | string | | sdkAppId | string | | templates | Template[] |

| 模板属性 | 类型 | 枚举值 | |--------------|-------------|-------------------------------------------------------| | templateCode | string | N/A | | usageType | enum string | 'Register' \ | 'SignIn' | 'ForgotPassword' | 'Generic' |

参考