Create a user

When you add an authentication method in the dropdown, you do NOT have to manually create users. Only create users this way if you have your own authentication system.

Import the function at the top of your file

import { createUser } from "swizzle-js";

Create a user with createUser(properties?, request?)

Optional: Pass any object as the first parameter to set custom keys and values.

Optional: Pass the request object as the second parameter to save the new user's IP address

Returns the new user object

const newUser = await createUser({"any_key": "any_value"})

const newUserWithIp = await createUser(null, request)

Last updated