Assistant creation via node server sdk how to set ...
# support
s
I am creating a assistant in vapi using the node server sdk and it works and all but setting the server webhook secret did not work as expected or i do not yet understand how to properly pass it in. I am currently doing this: server: { url: "my-webhook-url", headers: { "x-vapi-secret": "my-webhook-secret", }, }, This does not work. I had to manually set the secret in the dashboard myself. So what is the correct way of doing this? PS: I cannot find any secret in the types for the assistant creation.
c
Use the Node SDK, pass it as server: { url: "your-url", secret: "your-secret" } when creating the assistant, this sends the secret as an x-vapi-secret header, which your webhook must use to verify requests manually setting the secret in the dashboard works because it configures the same header server-side..
s
Then the types might be incorrect on the sdk, cause i do not get secret as an option.
c
The Vapi API supports server.secret for webhook authentication, but the Node SDK’s TypeScript types omit it, so you must either update the SDK, set it via raw API, or configure it manually in the dashboard until the types are fixed..
s
Yes i can confirm this fixed it.
c
Glad the issue was resolved. Please reach out to us if you have any other questions regarding this issue
2 Views