Skip to main content

signUp

User registration (❗️For providers with user activation, an activation code is sent through the corresponding user notification method)

Description

Method accepts the body as a parameter. It returns a Promise that resolves to an ISignUpEntity object.

AuthProvider.signUp(

marker*, body*, body.formIdentifier*, body.langCode, body.authData*, body.formData*, formData.marker*, formData.type*, formData.value*, body.notificationData*, notificationData.email*, notificationData.phonePush*, notificationData.phoneSMS, langCode

);

Parameters schema

Schema

marker(required): string
The text identifier of the authorization provider
example: "email"

body(required): ISignUpData
Request body
example:

{
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "example@oneentry.cloud"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Name"
}
],
"notificationData": {
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}
}

body.formIdentifier(required): string
The identifier for the registration form.
example: "reg"

body.langCode: string
Language code. Default: "en_US".

body.authData(required): Array
An array of authentication data objects, each containing a marker and its corresponding value.

body.formData(required): IAuthFormData | IAuthFormData[]
The form data for the registration.

formData.marker(required): string
A unique identifier for the form field.
example: "email"

formData.type(required): string
The type of the form field, such as 'string', 'email', etc.
example: "string"

formData.value(required): string
The value entered in the form field.
example: "example@oneentry.cloud"

body.notificationData(required): INotificationData
An object containing notification data, including email, phonePush, and phoneSMS.

notificationData.email(required): string
User's email used for notifications.
example: "example@oneentry.cloud"

notificationData.phonePush(required): string[]
Phone numbers used for push notifications.
example: ["+19999999999"]

notificationData.phoneSMS: string
Phone number used for SMS notifications.
example: "+19999999999"

langCode: string
Language code. Default: "en_US"
example: "en_US"

Examples

Try it live

Run this method interactively in the JS SDK sandbox — connect your Project URL and App Token on first visit, then open:

  • Register user — fetch a sign-up form, collect the user data, and register the account via AuthProvider.signUp().

Minimal example


const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "example@oneentry.cloud"
},
{
"marker": "password",
"value":"12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Name"
}
],
"notificationData": {
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}
};

const response = await AuthProvider.signUp('email', body);

Example with attributes of simple types formData "string", "integer", "float".

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "last_name",
"type": "string",
"value": "Fyodor Ivanov"
}
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Example with attributes of types "date", "dateTime", "time"

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "birthday",
"type": "date",
"value": {
"fullDate": "2024-05-07T21:02:00.000Z",
"formattedValue": "08-05-2024 00:02",
"formatString": "DD-MM-YYYY HH:mm"
}
}
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Example with attribute of type "text"

For a text field value, you can use one of three value types:

  • htmlValue - HTML string
  • plainValue - string
  • mdValue - Markdown string
const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "about",
"type": "text",
"value": {
"htmlValue": "<p>This is me</p>",
// "plainValue": "",
// "mdValue": ""
}
}
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Example with attribute type "textWithHeader"

For a textWithHeader field value, you can use one of three value types:

  • htmlValue - HTML string
  • plainValue - string
  • mdValue - Markdown string
const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
"formData": [
{
"marker": "about",
"type": "textWithHeader",
"value": {
"header": "Header",
"htmlValue": "<p>This is me</p>",
// "plainValue": "",
// "mdValue": ""
}
}
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Example with attributes type "image" and "groupOfImages"

If a fileQuery object is provided in the formData object, the file will be automatically uploaded to the OneEntry cloud via the SDK or use the File.uploadFile() handle See example

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
formData: [
{
marker: "image",
type: "image",
value: [file],
fileQuery: {
type: "page",
entity: "editor",
id: 3492,
},
},
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Example with attribute type "file"

If a fileQuery object is provided in the formData object, the file will be automatically uploaded to the OneEntry cloud via the SDK or use the File.uploadFile() handle See example

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
formData: [
{
marker: "image",
type: "image",
value: [file],
fileQuery: {
type: "page",
entity: "editor",
id: 3492,
},
},
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Example with attributes type "radioButton" and "list"

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
formData: [
{
marker: "list",
type: "list",
value: ["1"],
},
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Example with attribute type "entity" (nested list)

const body = {
"formIdentifier": "reg",
"authData": [
{
"marker": "login",
"value": "test"
},
{
"marker": "password",
"value": "12345"
}
],
formData: [
{
marker: "entity",
type: "entity",
value: [2954, 2957],
},
],
"notificationData": {
"email": "your-email@test.zone",
"phonePush": [],
"phoneSMS": "+19991234567"
}
};

const response = await AuthProvider.signUp('email', body);

Example response

{
"identifier": "my-id",
"id": 1764,
"createdDate": "1991-08-18T06:18:10.986Z",
"updatedDate": "1967-12-02T16:45:02.051Z",
"version": 10,
"isActive": false,
"isDeleted": false,
"formData": {
"en_US": [
{
"marker": "login",
"type": "string",
"value": "test"
},
{
"marker": "f-name",
"type": "string",
"value": "Ivanov"
}
]
},
"state": {},
"notificationData": {
"email": "test@test.ru",
"phonePush": [],
"phoneSMS": "+89991234567"
},
"locale": "en_US",
"deletedAt": "2023-02-12 10:56",
"rating": {
"value": 4.5,
"like": 10,
"dislike": 2,
"method": "average"
}
}

Response schema

Schema: ISignUpEntity

id: number
The unique identifier of the sign-up entity.
example: 12345

updatedDate: string
The date when the sign-up entity was last updated.
example: "2023-10-01T12:00:00Z"

version: number
The version number of the sign-up entity.
example: 1

identifier: string
A unique string that identifies the sign-up entity.
example: "signup_12345"

isActive: boolean
Indicates whether the sign-up entity is active.
example: true

formData: IAuthFormData[]
Form data array.
example:

[
{
"marker": "first_name",
"value": "John"
}
]

formData.marker: string
A unique identifier for the form field.
example: "email"

formData.type: string
The type of the form field, such as 'string', 'email', etc.
example: "string"

formData.value: string
The value entered in the form field.
example: "example@oneentry.cloud"

notificationData: INotificationData
An object containing notification data, including email, phonePush, and phoneSMS.
example:

{
"email": "example@oneentry.cloud",
"phonePush": [
"+99999999999"
],
"phoneSMS": "+99999999999"
}

notificationData.email: string
User's email used for notifications.
example: "example@oneentry.cloud"

notificationData.phonePush: string[]
Phone numbers used for push notifications.
example: ["+19999999999"]

notificationData.phoneSMS: string
Phone number used for SMS notifications.
example: "+19999999999"

locale: string
The locale or language code associated with the sign-up entity.
example: "en_US"

createdDate: string
The date when the sign-up entity was created.
example: "2023-10-01T12:00:00Z"

importId: unknown
Import identifier.
example: null

deletedAt: string | null
Deletion date or null.
example: null

isDeleted: boolean
Whether the entity is deleted.
example: false

state: Record<string, unknown>
Additional state information.
example:

rating: IRating
Rating data.