Hi! I’m trying to use the nodeJS SDK to create a n...
# ask-a-descoper
a
Hi! I’m trying to use the nodeJS SDK to create a new user. However, I don’t seem to be receiving email invitations for users created using the SDK. Creating a user with the same email from the console sends the invite as expected. I was wondering if that’s the expected behavior?
r
You using this management SDK https://docs.descope.com/manage/users/?
And is the user created in the system when you use the nodejs SDK. You should see the user in user table.
g
Hi @Ashley Wong. At this point indeed inviting users via the SDK does not trigger an email. The thought process behind it is that using the SDK to invite might be part of a broader user provisioning process, which will trigger the relevant email as well. Can you share some details about your use case? if this is something you would like to see - we can definitely with the team to add it.
👀 1
a
Interesting! At the moment I’m trying to allow Tenant admins to add users to their tenant (Only certain member of their org have access to our platform so I’ve blocked self-sign up). It’s all good though, I didn’t realize that users could sign in as soon as they had been invited, I thought they needed email confirmation. I’ll just have invited users sign in directly! Thanks
👍 1
One more question! I’ve been trying to create users with the following user tenant, but the roles array is always empty in
resp.data
. What am I doing incorrectly there? Should I be using a different string for tenant admin?
const userTenants = [{ tenantId: 'test', roles: ['Tenant Admin'] }]
i
Hey Ashley, it should be
roleNames
instead of
roles
. Are you using JS or TS? Give it a try and LMK if you have more issues.
a
I’m using TS!
roleNames
worked but only when I created a new role (i.e I couldn’t use ‘Tenant Admin’), that’s okay though I’ll just set up the same permissions for a new role. Btw, it looks like your documentation might be wrong, the sample code here uses
roles
Thanks for all your help!
d
Thanks for letting us know! We will fix this! @Gilad Shriki FYI