cartwright
Features

Phone.inc telephony

A click-to-call widget behind the phoneWidget flag, plus an admin preview page, a token route and a webhook that are scaffolds. Nothing about calls is stored yet.

Preview. The Phone.inc integration is a scaffold. The storefront widget is real, but the admin page shows sample data, the token route returns a placeholder token, and the webhook stores nothing. The Phone.inc API does not yet document everything the integration needs, so the rest waits on them. Track readiness in the roadmap.

This page describes what engine v0.68.0 ships. Phone.inc is meant to become Cartwright's bridge between voice and the rest of the shop: call history next to order history, and voicemails you can search. Today only the storefront widget does anything for a visitor. The other parts are the outline of that integration, and this page says which is which.

The widget

The phoneWidget flag (runtime, off by default) mounts a floating phone button in the bottom-left corner of every storefront page. Turn it on in /admin/features.

What the visitor sees depends on whether a Phone.inc workspace is configured:

  • With phoneIncWorkspaceId set, the page loads Phone.inc's widget script (https://widget.phone.inc/v1/widget.js?workspace=<id>) and shows a small "Phone.inc Active" badge.
  • Without it, the button opens a demo call panel. "Start Web Call" plays a ringing state and then a connected state, but no call is placed.

The widget carries a data-cw-phone-widget attribute, so a custom design can restyle it without depending on its Tailwind classes.

Configuration

IntegrationSettings has two Phone.inc fields:

FieldWhat reads it today
phoneIncWorkspaceIdThe storefront layout, which passes it to the widget
phoneIncApiKeyNothing yet. It is stored for the API calls that are still to come

Both are set in the setup wizard at /admin/setup, in its "Email & Domain" step. /admin/integrations has no Phone.inc card yet.

/admin/telefon

The Telephony entry under "Marketing & contact" in the admin sidebar opens a preview of the dashboard. It has two tabs:

  1. Call History shows three fixed sample rows, not calls from Phone.inc. The "Active Number" at the top is a sample too.
  2. AI Answering Machine (IVR) has one text box for the greeting Phone.inc's voice would read aloud. "Save IVR Settings" posts to /api/admin/phone, which answers that the save went through, but nothing is stored and nothing is sent to Phone.inc. Reload the page and the greeting is back to the default.

/api/admin/phone requires an admin session for both GET and POST. Its GET returns one sample call.

/api/phone/token

A POST returns a placeholder in the shape a browser call token would have:

{ "success": true, "token": "phone_inc_mock_…", "expires_in": 3600 }

The token is not issued by Phone.inc and opens no session. The route checks no session, and nothing in the engine calls it yet. A real token needs Phone.inc to document how browser calls get one, and their API documentation does not cover that yet.

/api/phone/webhook

The endpoint you would give Phone.inc for call events. The handler reads the event and data fields of the JSON body and recognises seven event names: call.initiated, call.answered, call.ended, call.lost, voicemail.new, call.transcription_done and call.outside_opening_hours. It does nothing with any of them: nothing is stored, no customer is looked up and no event is de-duplicated. In v0.68.0 it writes the event name and its data object to the server log, then answers { "received": true }.

Authentication

The webhook has an optional shared-secret check:

  • With the environment variable PHONE_INC_WEBHOOK_SECRET unset, the webhook accepts every request.
  • With it set, the request must carry the same value, either in the x-phone-inc-signature header or as a ?token= query parameter. Anything else gets a 401 before the body is read. The comparison runs in constant time.

The secret is compared as it is. It is not a signature computed over the request body.

What's scaffolded vs wired

SurfaceStatus in v0.68.0
Storefront widgetWired, behind phoneWidget. Loads Phone.inc's script when a workspace id is set, otherwise shows a demo call panel
Workspace id and API key fieldsStored. Only the workspace id is read
/admin/telefon call historyScaffold: fixed sample rows
/admin/telefon IVR greetingScaffold: Save stores nothing
/api/phone/tokenScaffold: placeholder token, no session check
/api/phone/webhookScaffold: logs the event, stores nothing. Optional shared secret
Call log, voicemails, transcriptsNot built: no tables for them
Matching a caller to a customerNot built
Outbound calling, recording playbackNot built

Turning it off

Set phoneWidget off in /admin/features and the widget leaves the storefront. The Telephony entry in the admin sidebar, /admin/telefon and the three API routes stay reachable with the flag off, and with no keys configured. None of them stores anything, so there is no data to clean up and no migration to run.

On this page