const usersResponse = await fetch(
"https://{business_name}.kinde.com/api/v1/user",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${access_token}`,
},
body: JSON.stringify({
profile: {
given_name: firstName,
family_name: lastName,
},
organization_code: "org--------",
identities: [
{
type: "email",
details: {
email: email,
password: password,
},
},
],
}),
}
);
const userData = await usersResponse.json();
const usersResponse = await fetch(
"https://{business_name}.kinde.com/api/v1/user",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${access_token}`,
},
body: JSON.stringify({
profile: {
given_name: firstName,
family_name: lastName,
},
organization_code: "org--------",
identities: [
{
type: "email",
details: {
email: email,
password: password,
},
},
],
}),
}
);
const userData = await usersResponse.json();