import { RelayClient } from '@signalwire/sdk';
const client = new RelayClient({
project: process.env.SIGNALWIRE_PROJECT_ID!,
token: process.env.SIGNALWIRE_API_TOKEN!,
contexts: ['default']
});
client.onCall(async (call) => {
await call.answer();
// Bind some digit shortcuts
await call.bindDigit('*0', 'calling.transfer', {
bindParams: { dest: 'operator' },
realm: 'shortcuts',
});
// Later, remove all shortcut bindings
const result = await call.clearDigitBindings('shortcuts');
console.log(`Bindings cleared: ${JSON.stringify(result)}`);
});
await client.run();