Skip to content

Quickstart

Deploy a voice function from zero in about five minutes.

Prerequisites

  • CLI installed: npm install -g @sinch/cli
  • Authenticated: sinch auth login

If you have not done these yet, see Installation.

Step 1 — Authenticate

sinch auth login

The CLI prompts for your Project ID, Key ID, and Key Secret. Skip if already authenticated.

Step 2 — Initialize a function

sinch functions init simple-voice-ivr --name my-first-function

The CLI downloads the template and creates a my-first-function/ directory. For Node.js, it runs npm install automatically.

Beyond --name, init is interactive: it asks for any template-specific variables (for simple-voice-ivr, your company name), whether to auto-configure voice integration on deploy, and whether to enable a database (No / Basic / Pro). Pass --non-interactive to accept the defaults.

To see all available templates:

sinch templates list

Step 3 — Enter the project directory

cd my-first-function

Step 4 — Start the local development server

sinch functions dev

Select Yes when prompted about the tunnel to get a public URL that Sinch can reach. Leave this terminal running.

Step 5 — Test locally with curl

In a second terminal:

curl -s -X POST http://localhost:3000/ \
  -H "Content-Type: application/json" \
  -d '{"event":"call.incoming","call":{"callId":"01LOCALTEST0000000000000001","from":{"type":"PHONE","phone":{"number":"+15551234567"}},"to":{"type":"PHONE","phone":{"number":"+15559876543"}}}}' \
  | cat

You should receive a commands response with a voice menu.

Step 6 — Deploy

sinch functions deploy

The CLI packages your code, uploads it, and streams deployment progress:

Deployment Complete!
  Function: my-first-function
  Status: Running
  URL: https://<name>.fn.sinch.com

For C# functions, the CLI builds and health-checks locally before packaging.

On an interactive first deploy, the CLI asks whether to use a managed key (default: yes) and saves accessKey: "managed" or accessKey: "profile" in sinch.json; pass --managed-keys to select and persist managed keys without prompting. If accessKey is already set it is reused, and --non-interactive or a truthy CI environment variable uses profile for that deploy without writing the field.

Step 7 — Watch logs

sinch functions logs --interactive

Opens an interactive terminal UI showing each request. Arrow keys to navigate, Enter to expand, q to exit.

What's next

We'd love to hear from you!
Rate this content: