Skip to content
Last updated

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.

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/ice \
  -H "Content-Type: application/json" \
  -d '{"callid":"test-123","cli":"+15551234567","to":{"type":"number","endpoint":"+15559876543"},"domain":"pstn","originationType":"pstn"}' \
  | cat

You should receive a SVAML 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://fn-<id>.functions.sinch.com

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

Step 7 — Watch logs

sinch functions logs --follow

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

What's next