{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/functions/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["partial"]},"type":"markdown"},"seo":{"title":"Developer Documentation","siteUrl":"https://developers.sinch.com","llmstxt":{"title":"Sinch Developer Documentation","description":"LLMs.txt containing a map of all the documentation files for Sinch.","sections":[{"title":"SMS API","description":"The SMS API allows you to send and receive SMS messages with a few easy steps. You can also send bulk SMS messages to multiple customers using the Sinch SMS service.","includeFiles":["docs/sms/**/*.md","docs/sms/**/*.yaml"],"excludeFiles":["docs/sms/index.md"]},{"title":"Numbers API","description":"The Numbers API enables you to search for, view, and activate numbers. It's considered a precursor to other APIs in the Sinch product family. The numbers API can be used in tandem with any of our APIs that perform messaging or calling.","includeFiles":["docs/numbers/**/*.md","docs/numbers/**/*.yaml"],"excludeFiles":["docs/numbers/index.md"]},{"title":"Conversation API","description":"Send and receive messages globally on many popular channels with ease and confidence when using Sinch's Conversation API. Conversation API is the preferred API for sending mobile messages on SMS and other social channels with Sinch. It is a simple API with unified error messages, consistent request payloads, and common webhook payloads that are channel-agnostic.","includeFiles":["docs/conversation/**/*.md","docs/conversation/**/*.yaml"],"excludeFiles":["docs/conversation/index.md"]},{"title":"Voice API","description":"The Voice API works as a big telephony switch. The Voice API handles incoming phone calls (also known as incoming call “legs”), sets up outgoing phone calls (or outgoing call “legs”), and bridges the two. The incoming call leg may come in over a data connection (from a smartphone or web application using the Sinch SDKs) or through a local phone number (from the PSTN network). Similarly, the outgoing call leg can be over data (to another smartphone or web application using the Sinch SDKs) or the PSTN network.","includeFiles":["docs/voice/**/*.md","docs/voice/**/*.yaml"],"excludeFiles":["docs/voice/index.md"]},{"title":"Verification API","description":"The Verification API is a platform for phone number verification. It consists of the API and different software development kits (the Sinch SDKs) that you integrate with your smartphone or web application and cloud based back-end services. Together they enable SMS, Flashcall, Phone Call and Data verification in your application.","includeFiles":["docs/verification/**/*.md","docs/verification/**/*.yaml"],"excludeFiles":["docs/verification/index.md"]},{"title":"Provisioning API","description":"Provisioning API allows you to programmatically set up your senders, accounts and templates on your favorite messaging platforms on the Conversation API. For now, you can create your first WhatsApp channel through Meta's Embedded sign up, you can configure your first SMS App and configure your webhooks. As development continues, we will be adding the most commonly used channels.","includeFiles":["docs/provisioning-api/**/*.md","docs/provisioning-api/**/*.json"],"excludeFiles":["docs/provisioning-api/index.md"]},{"title":"Elastic SIP Trunking API","description":"With Elastic SIP Trunking you can create and manage your SIP trunks and phone numbers programmatically.","includeFiles":["docs/est/**/*.md","docs/est/**/*.yaml"],"excludeFiles":["docs/est/index.md"]},{"title":"Fax API","description":"Send and receive HIPAA compliant faxes on our modern fax platform using our developer-friendly API.","includeFiles":["docs/fax/**/*.md","docs/fax/**/*.yaml"],"excludeFiles":["docs/fax/index.md"]},{"title":"In-app Voice and Video SDK","description":"The In-app Voice and Video SDK enables you to add voice and video calling capabilities directly into your mobile or web application using the Sinch SDKs.","includeFiles":["docs/in-app-calling/**/*.md"],"excludeFiles":["docs/in-app-calling/index.md"]}],"hide":false,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"configuration--secrets","__idx":0},"children":["Configuration & secrets"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every non-trivial function needs configuration: a company name for the welcome message, API keys for upstream services, phone numbers for routing. Sinch Functions draws a hard line between two things:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Variables"]}," — non-sensitive settings that can live in source control."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Secrets"]}," — sensitive values that must never touch source control."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["They flow through different mechanisms, and the distinction is worth understanding before you start storing things."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"variables-vs-secrets","__idx":1},"children":["Variables vs secrets"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variables"},"children":["Variables"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Secrets"},"children":["Secrets"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Examples"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Company name, support number, feature flags"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["API keys, passwords, client secrets"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Stored in"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch.json"]}," → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["variables"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["OS keychain (local) + platform secret store (production)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Committed?"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes — checked into your repo"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".env"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".gitignore"]},"d by default"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Updated with"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Edit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch.json"]}," + redeploy"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch secrets add KEY value"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Visible in logs"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Plain text"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Redacted"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Available as"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["process.env.FOO"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IConfiguration[\"FOO\"]"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Same — runtime injects both into env vars"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"declaring-variables--sinchjson","__idx":2},"children":["Declaring variables — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch.json"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"name\": \"my-function\",\n  \"runtime\": \"nodejs20\",\n  \"variables\": {\n    \"COMPANY_NAME\": \"Acme Corp\",\n    \"SUPPORT_NUMBER\": \"+15551234567\",\n    \"ENABLE_RECORDING\": \"true\"\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Variables are bundled into the deploy and loaded into the runtime's environment on startup. To update one, edit ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch.json"]}," and run ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch functions deploy"]}," again."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"declaring-secrets--env-and-sinch-secrets","__idx":3},"children":["Declaring secrets — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".env"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch secrets"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your project's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".env"]}," file lists the secret keys your function needs. The values are left empty because the CLI loads them from the OS keychain at dev time."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# .env — keys only, values come from the keychain\nPROJECT_ID=\nPROJECT_ID_API_KEY=\nPROJECT_ID_API_SECRET=\nSTRIPE_SECRET_KEY=\nELEVENLABS_API_KEY=\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store the values once with the CLI:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"sinch secrets add STRIPE_SECRET_KEY sk_live_abc123\nsinch secrets add ELEVENLABS_API_KEY ...\nsinch secrets list\nsinch secrets get STRIPE_SECRET_KEY\nsinch secrets delete STRIPE_SECRET_KEY\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Secrets are scoped per function — the function name in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch.json"]}," is the keychain namespace. Two functions with different names have isolated secret stores."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"where-the-keychain-actually-is","__idx":4},"children":["Where the keychain actually is"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Platform"},"children":["Platform"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Storage backend"},"children":["Storage backend"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Windows"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Windows Credential Manager"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["macOS"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Keychain Access"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Linux"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Secret Service API (libsecret / GNOME Keyring)"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On Linux without a graphical session you may need to install ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["libsecret"]}," and configure a keychain daemon."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"reading-configuration-from-your-handler","__idx":5},"children":["Reading configuration from your handler"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"nodejs--createconfig","__idx":6},"children":["Node.js — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createConfig"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The richest API is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createConfig(context)"]}," (aka ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createUniversalConfig"]},"):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { createConfig } from '@sinch/functions-runtime';\n\nconst config = createConfig(context);\n\nconst apiKey = config.requireSecret('STRIPE_SECRET_KEY');         // throws if missing\nconst companyName = config.getVariable('COMPANY_NAME', 'Acme Corp');\nconst creds = config.getApplicationCredentials();                  // voice app key/secret\n\nif (config.isDevelopment()) { /* local dev only */ }\nif (config.isProduction())  { /* deployed only */ }\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["process.env"]}," still works if you want the raw access:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const companyName = process.env.COMPANY_NAME ?? 'Acme Corp';\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"c--iconfiguration","__idx":7},"children":["C# — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IConfiguration"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["C# gets ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IConfiguration"]}," injected into controllers by ASP.NET:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"csharp","header":{"controls":{"copy":{}}},"source":"var companyName = Configuration[\"COMPANY_NAME\"] ?? \"Acme Corp\";\nvar apiKey = Configuration[\"STRIPE_SECRET_KEY\"]\n    ?? throw new InvalidOperationException(\"STRIPE_SECRET_KEY is required\");\n","lang":"csharp"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IConfiguration"]}," reads from environment variables (what the runtime populates from variables + secrets) and from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["appsettings.json"]}," if you have one."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"the-base-sinch-credentials","__idx":8},"children":["The base Sinch credentials"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every function needs three environment variables for the Sinch SDK clients to initialize. They come from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch auth login"]}," and are stored in your OS keychain:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Variable"},"children":["Variable"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Source"},"children":["Source"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROJECT_ID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch auth login"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROJECT_ID_API_KEY"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch auth login"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PROJECT_ID_API_SECRET"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch auth login"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These are automatically injected during ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch functions dev"]}," and shipped with each deploy — you do not need to manage them in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".env"]}," yourself."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"environment-variables-that-unlock-sdk-clients","__idx":9},"children":["Environment variables that unlock SDK clients"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The runtime initializes a Sinch SDK client only if its required environment variables are present. Set these either via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch.json"]}," variables (if they are non-secret identifiers) or via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch secrets add"]}," (if they are credentials)."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Client"},"children":["Client"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required variables"},"children":["Required variables"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Voice"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VOICE_APPLICATION_KEY"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VOICE_APPLICATION_SECRET"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Conversation"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CONVERSATION_APP_ID"]}," (+ optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CONVERSATION_REGION"]},": US/EU/BR)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SMS"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SMS_SERVICE_PLAN_ID"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Numbers"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ENABLE_NUMBERS_API=true"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Verification (C#)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VERIFICATION_APPLICATION_ID"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VERIFICATION_APPLICATION_SECRET"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If a variable is missing, the corresponding ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["context.voice"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["context.conversation"]}," / etc. property is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["null"]}," and you should check before using it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"environment-detection","__idx":10},"children":["Environment detection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The runtime sets these automatically:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Environment"},"children":["Environment"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Node.js"},"children":["Node.js"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"C#"},"children":["C#"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Local dev"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NODE_ENV=development"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ASPNETCORE_ENVIRONMENT=Development"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Production"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NODE_ENV=production"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ASPNETCORE_ENVIRONMENT=Production"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use them for dev-only logging, feature toggles, or bypassing integrations that do not exist locally."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-it-all-flows-together","__idx":11},"children":["How it all flows together"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"sinch auth login ──▶ OS keychain ──┐\n                                    │\nsinch secrets add KEY val ─▶ keychain┤\n                                    ├──▶ sinch functions dev  ──▶ process.env in your local runtime\nsinch.json (variables)      ────────┤\n                                    │\nsinch.json (variables)      ────────┤\n                                    ├──▶ sinch functions deploy ─▶ Sinch platform secret store ─▶ process.env in production\nsinch secrets add KEY val ─▶ keychain┘\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The CLI reconciles the three sources (keychain, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch.json"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".env"]},") at deploy time, uploads everything, and the platform injects the final set as environment variables when your container starts. Secrets are encrypted at rest on the platform and redacted from logs."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related","__idx":12},"children":["Related"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"#"},"children":["Context object"]}," — how to access variables from your handler code"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"/docs/functions/cli/commands/secrets"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sinch secrets"]}," commands"]}," — full CLI reference"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"a","attributes":{"href":"#"},"children":["Local vs prod"]}," — what else changes between environments"]}]}]},"headings":[{"value":"Configuration & secrets","id":"configuration--secrets","depth":1},{"value":"Variables vs secrets","id":"variables-vs-secrets","depth":2},{"value":"Declaring variables — sinch.json","id":"declaring-variables--sinchjson","depth":2},{"value":"Declaring secrets — .env and sinch secrets","id":"declaring-secrets--env-and-sinch-secrets","depth":2},{"value":"Where the keychain actually is","id":"where-the-keychain-actually-is","depth":3},{"value":"Reading configuration from your handler","id":"reading-configuration-from-your-handler","depth":2},{"value":"Node.js — createConfig","id":"nodejs--createconfig","depth":3},{"value":"C# — IConfiguration","id":"c--iconfiguration","depth":3},{"value":"The base Sinch credentials","id":"the-base-sinch-credentials","depth":2},{"value":"Environment variables that unlock SDK clients","id":"environment-variables-that-unlock-sdk-clients","depth":2},{"value":"Environment detection","id":"environment-detection","depth":2},{"value":"How it all flows together","id":"how-it-all-flows-together","depth":2},{"value":"Related","id":"related","depth":2}],"frontmatter":{"seo":{"title":""}},"lastModified":"2026-04-15T14:23:23.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/functions/concepts/configuration-secrets","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}