InviteMember roles as array

Hi in the docs it says we can set multiple roles in an invitation:

await authClient.organization.inviteMember({
    email: "test@email.com",
    role: "admin", //this can also be an array for multiple roles (e.g. ["admin", "sale"])
})


But when trying to do so I get error:
{
    "code": "VALIDATION_ERROR",
    "message": "Invalid body parameters"
}


Types in the intellisense also says it has to be a string:

const response = await authClient.organization.inviteMember({
email: parsedValue.email,
role: parsedValue.roles, // Has to be string
})
Was this page helpful?