sinch-sdks

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Sinch SDKs

Sinch SDK

Overview

概述

Cross-cutting skill that covers SDK installation and client initialization for all Sinch products. Determines the correct SDK and provides init code per language.
For authentication setup (credentials, OAuth2, Basic auth, signed requests), see sinch-authentication. For In-App Calling SDKs (Browser, iOS, Android), see sinch-in-app-calling.
这是一项跨领域技能,涵盖所有Sinch产品的SDK安装与客户端初始化操作。可根据语言确定合适的SDK并提供对应的初始化代码。
如需了解认证设置(凭证、OAuth2、基础认证、签名请求),请查看sinch-authentication。如需了解应用内通话SDK(浏览器、iOS、Android),请查看sinch-in-app-calling

Agent Instructions

Agent操作指引

If the user hasn't specified which language or platform, ask first — the SDK and init pattern differ by language. Use the table below to route to the correct reference.
如果用户未指定语言或平台,请先询问——不同语言对应的SDK和初始化模式有所不同。请使用下方表格跳转至正确的参考文档。

SDK Installation

SDK安装

LanguagePackageInstallAuth Scope
Node.js
@sinch/sdk-core
npm install @sinch/sdk-core
Project + Application
Python
sinch
pip install sinch
Project + Application
Java
com.sinch.sdk:sinch-sdk-java
Maven dependencyProject + Application
.NET
Sinch
NuGet packageProject + Application
In-App Calling uses a separate client-side SDK — not
@sinch/sdk-core
. See sinch-in-app-calling.
语言包名安装命令认证范围
Node.js
@sinch/sdk-core
npm install @sinch/sdk-core
项目 + 应用
Python
sinch
pip install sinch
项目 + 应用
Java
com.sinch.sdk:sinch-sdk-java
Maven依赖项目 + 应用
.NET
Sinch
NuGet包项目 + 应用
应用内通话使用独立的客户端SDK——并非
@sinch/sdk-core
。请查看sinch-in-app-calling

Product Coverage by SDK

SDK支持的产品

Not all products are available in all SDKs. Check the table before recommending an SDK for a specific product.
ProductNode.jsJava.NETPython
Conversation API⚠️⚠️
Voice API
Verification API
Numbers API
Number Lookup API
Elastic SIP Trunking
Fax API⚠️
Provisioning API
10DLC Registration
✅ = supported, ⚠️ = partial/preview, ❌ = not available (use direct HTTP)
When a product is not supported in the user's chosen SDK, guide them to use direct HTTP calls instead.
并非所有产品都支持所有SDK。在为特定产品推荐SDK前,请先查看下表。
产品Node.jsJava.NETPython
Conversation API⚠️⚠️
Voice API
Verification API
Numbers API
Number Lookup API
Elastic SIP Trunking
Fax API⚠️
Provisioning API
10DLC注册
✅ = 支持,⚠️ = 部分支持/预览版,❌ = 不支持(请使用直接HTTP调用)
当用户所选SDK不支持某产品时,请引导其使用直接HTTP调用。

SDK Init References

SDK初始化参考文档

For language-specific initialization code, use the references:
  • Node.js: references/sdk-init-node.md
  • Python: references/sdk-init-python.md
  • Java: references/sdk-init-java.md
  • .NET: references/sdk-init-dotnet.md
If language is unknown, ask first. The SDKs handle token refresh automatically.
如需特定语言的初始化代码,请查看以下参考文档:
  • Node.js: references/sdk-init-node.md
  • Python: references/sdk-init-python.md
  • Java: references/sdk-init-java.md
  • .NET: references/sdk-init-dotnet.md
如果未知语言,请先询问。SDK会自动处理令牌刷新。

Key Concepts

核心概念

@sinch/sdk-core
— Unified Node.js SDK covering all project-scoped and application-scoped Sinch APIs. Individual packages (e.g.,
@sinch/voice
,
@sinch/verification
) are also available.
sinch
(Python)
— Python SDK (v2.0.0+) covering project-scoped and application-scoped APIs.
sinch-sdk-java
— Java SDK (v2.0.0+) via Maven Central.
Project-scoped init — Uses
projectId
,
keyId
,
keySecret
. For Conversation, Numbers, Fax, EST, 10DLC, Number Lookup, Provisioning.
Application-scoped init — Uses
applicationKey
,
applicationSecret
. For Voice, Verification, In-App Calling.
Multi-product client — Provide both project and application credentials in a single
SinchClient
to access all APIs.
Conversation region — Must be set explicitly when using the Conversation API. Values:
us
,
eu
,
br
. Required in Python SDK v2.0.0+ and Java SDK v2.0.0+; recommended in Node.js and .NET.
@sinch/sdk-core
—— 统一的Node.js SDK,涵盖所有项目级和应用级Sinch API。也提供独立包(如
@sinch/voice
@sinch/verification
)。
sinch
(Python)
—— Python SDK(v2.0.0+),涵盖项目级和应用级API。
sinch-sdk-java
—— Java SDK(v2.0.0+),可通过Maven Central获取。
项目级初始化 —— 使用
projectId
keyId
keySecret
。适用于Conversation、Numbers、Fax、EST、10DLC、Number Lookup、Provisioning产品。
应用级初始化 —— 使用
applicationKey
applicationSecret
。适用于Voice、Verification、应用内通话产品。
多产品客户端 —— 在单个
SinchClient
中同时提供项目和应用凭证,以访问所有API。
对话区域 —— 使用Conversation API时必须显式设置。可选值:
us
eu
br
。Python SDK v2.0.0+和Java SDK v2.0.0+要求必须设置;Node.js和.NET建议设置。

Common Patterns

常见模式

  • Project-scoped quick start — Init
    SinchClient
    with project credentials. See language-specific ref.
  • Application-scoped quick start — Init
    SinchClient
    with app key/secret. See language-specific ref.
  • Multi-product client — Pass both credential sets to a single client instance.
  • Regional Conversation API — Set
    conversationRegion
    during init (required in Python/Java, recommended elsewhere).
  • 项目级快速入门 —— 使用项目凭证初始化
    SinchClient
    。请查看对应语言的参考文档。
  • 应用级快速入门 —— 使用应用密钥/凭证初始化
    SinchClient
    。请查看对应语言的参考文档。
  • 多产品客户端 —— 将两组凭证传递给单个客户端实例。
  • 区域化Conversation API —— 初始化时设置
    conversationRegion
    (Python/Java要求必须设置,其他语言建议设置)。

Gotchas

注意事项

  • Not all products are available in all SDKs — Check the Product Coverage table before recommending an SDK. For unsupported products, use direct HTTP calls.
  • Conversation region is required — Python and Java SDKs fail at runtime without
    conversation_region
    . Node.js and .NET don't enforce it yet but should set it explicitly.
  • Voice/Verification use application credentials — These are a separate credential set from project Access Keys.
  • SDKs auto-refresh OAuth2 tokens — No need to manually handle token expiry when using SDKs.
  • 并非所有产品都支持所有SDK —— 在推荐SDK前请先查看产品支持表。对于不支持的产品,请使用直接HTTP调用。
  • 对话区域为必填项 —— Python和Java SDK如果未设置
    conversation_region
    会在运行时失败。Node.js和.NET目前未强制要求,但建议显式设置。
  • Voice/Verification使用应用凭证 —— 这些凭证与项目访问密钥是独立的。
  • SDK会自动刷新OAuth2令牌 —— 使用SDK时无需手动处理令牌过期。

Links

链接