Using metadata with Assistant_Overrides
# support
m
Hi, I'm, trying to pass the metadata using the AssistantOverrides like this: // Create assistantOverrides with metadata const assistantOverrides = { metadata: { user_id: "1616161", user_name: "Kelly", project_id: "12345", }, }; // Use the assistant ID from the URL parameter and pass assistantOverrides vapi.start(assistantId, assistantOverrides); }; I believe it's the right way of using it according to the documentation here: https://docs.vapi.ai/sdk/web ; However, when I'm starting the call, only the assistantId is being passed looking at the request payload: {"assistantId":"2b9ca1c2-5be2-4de6-8e24-358337575a3c"} I cant see any assistantOverrides parametres passed as the part of request. The request output looks like this: { "id": "ae424b3c-547a-4e61-a2fd-3ed3e1ef0a30", "orgId": "4bd0ce5d-5f05-4b46-a06f-8a2db48953b7", "createdAt": "2024-09-05T10:54:40.569Z", "updatedAt": "2024-09-05T10:54:40.569Z", "type": "webCall", "monitor": { "listenUrl": "wss://aws-us-west-2-production3-phone-call-websocket.vapi.ai/ae424b3c-547a-4e61-a2fd-3ed3e1ef0a30/transport", "controlUrl": "https://aws-us-west-2-production3-phone-call-websocket.vapi.ai/ae424b3c-547a-4e61-a2fd-3ed3e1ef0a30/control" }, "webCallUrl": "https://vapi.daily.co/j0JsRZ0ylL9h4OBuurpk", "status": "queued", "assistantId": "2b9ca1c2-5be2-4de6-8e24-358337575a3c" } Any suggestions how to pass the metadata parameters with the assistantOverrides option?
v
You can continue this conversation by mentioning me in the message.
@MaxM It's great to see you're using the AssistantOverrides to pass metadata. Based on the documentation you've referenced and the code snippet you've provided, it seems like you're on the right track. However, if the metadata isn't appearing in the request payload, there might be an issue with how the
vapi.start
function is handling the
assistantOverrides
object. Here are a few suggestions to ensure the metadata is passed correctly: 1. Double-check the version of the VAPI SDK you're using to ensure it supports the
assistantOverrides
feature as expected. 2. Verify that the
vapi.start
function is implemented correctly and that it's designed to accept an
assistantOverrides
parameter. 3. Ensure that there are no errors in the code that might prevent the
assistantOverrides
from being included in the request payload. 4. If you're using a bundler or minifier, make sure it's not stripping out or altering the
assistantOverrides
object. 5. Check the network requests in your browser's developer tools to confirm that the payload being sent matches what you expect. 6. Review the server-side implementation to ensure that it's capable of receiving and processing the
assistantOverrides
metadata. If you've gone through these checks and the issue persists, it might be best to reach out to VAPI support for further assistance. They may be able to provide more specific guidance or identify if there's a bug or a missing feature in the SDK. Please let me know if you need further assistance or if there's anything else I can do to help!
Got it. Tagging @User for additional help.
s
@MaxM can you share the complete code snippet on how your passing it in DM>
m
Thanks @Shubham Bajaj ; Solved it, the problem was with the older version of vapi/web. I updated it to the newer version and it worked ok.
15 Views