# @meecode/ng112-reg-js

> ## Table of Contents - [Installation](#Installation) - [Exposed Classes](#exposed-classes) - [Prerequisites](#Prerequisites) - [Usage](#Usage) - [Registration Client](#Registration-Client) - [Initializing the registration client](#initializi

Latest version **3.0.6** (published 2026-03-02) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install @meecode/ng112-reg-js
pnpm add @meecode/ng112-reg-js
yarn add @meecode/ng112-reg-js
bun add @meecode/ng112-reg-js
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.6 |
| Published | 2026-03-02 |
| First published | 2021-04-16 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 413.9 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Author | MeeCode by Mario Murrent |
| Maintainers | meecodebymariomurrent |
| Keywords | ng112 |

## Links

- npm: https://www.npmjs.com/package/@meecode/ng112-reg-js
- npm.io page: https://npm.io/package/@meecode/ng112-reg-js

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.25.0
- [ts.validator.fluent](https://npm.io/package/ts.validator.fluent.md) ^1.3.0

## Recent versions

- 3.0.6 (latest) — 2026-03-02
- 2.0.30-beta (beta) — 2024-02-22
- 3.0.5 — 2026-03-02
- 3.0.4 — 2026-01-28
- 3.0.3 — 2026-01-28
- 3.0.2 — 2025-12-29
- 3.0.1 — 2025-12-21
- 3.0.0 — 2025-12-21
- 2.0.29-beta — 2024-02-20
- 2.0.28-beta — 2024-01-23
- 2.0.27-beta — 2024-01-15
- 2.0.26-beta — 2023-12-31
- 2.0.25-beta — 2023-12-30
- 2.0.24-beta — 2023-11-30
- 2.0.23-beta — 2023-11-29
- … 46 more at https://npm.io/package/@meecode/ng112-reg-js/versions

## README

# ng112-reg-js

## Table of Contents
- [Installation](#Installation)  
- [Exposed Classes](#exposed-classes)
- [Prerequisites](#Prerequisites)
- [Usage](#Usage)
    - [Registration Client](#Registration-Client)
        - [Initializing the registration client](#initializing-the-registration-client)
        - [Register a device](#Register-a-device)
        - [Error Handling](#Error-Handling)
- [Methods & Properties](#Methods-&-Properties)
    - [DEC112RegistrationClient](#DEC112RegistrationClient)
        - [Constructor](#Constructor)
        - [UpdateRegistrationServer](#UpdateRegistrationServer)
        - [GetConfiguration](#GetConfiguration)
        - [GetRootConfiguration](#GetRootConfiguration)
        - [Register](#Register)
        - [CheckRegistration](#CheckRegistration)
        - [ResendPhoneVerificationCode](#ResendPhoneVerificationCode)
        - [Unregister](#Unregister)
        - [VerifyPhoneNumber](#VerifyPhoneNumber)
        - [EnableDebug](#EnableDebug)
        - [IsDebugEnabled](#IsDebugEnabled)
    - [PhoneVerificationData](#PhoneVerificationData)
    - [RegistrationData](#RegistrationData)
    - [RegistrationInformationData](#RegistrationInformationData)
    - [RequestDataError](#RequestDataError)
    - [Registration](#Registration)
    - [DeleteRegistration](#DeleteRegistration)
    - [AppConfiguration](#AppConfiguration)
    - [AppServices](#AppServices)
    - [AppService](#AppService)
    - [RootConfiguration](#RootConfiguration)
    - [Settings](#Settings)
    - [SettingsInvalidError](#SettingsInvalidError)
    - [NormalizePhoneNumberData](#NormalizePhoneNumberData)
    - [NormalizedPhoneNumber](#NormalizedPhoneNumber)
    - [CheckRegistrationData](#CheckRegistrationData)
    - [ResendVerificationCode](#ResendVerificationCode)
    - [RegistrationEndpoint](#RegistrationEndpoint)
    - [CountryRegistrationEndpoint](#CountryRegistrationEndpoint)
    - [RequestError](#RequestError)
    - [RegistrationState](#RegistrationState)
    - [InAppSearch](#InAppSearch)
    - [InAppSearchItem](#InAppSearchItem)

## Installation

```shell 
npm install @meecode/ng112-reg-js
```

## Exposed Classes

* [DEC112RegistrationClient](#DEC112RegistrationClient)
* [AppConfiguration](#AppConfiguration)
* [AppServices](#AppServices)
* [AppService](#AppService)
* [App](#App)
* [DeleteRegistration](#DeleteRegistration)
* [DeleteRegistrationData](#DeleteRegistrationData)
* [NormalizePhoneNumberData](#NormalizePhoneNumberData)
* [NormalizedPhoneNumber](#NormalizedPhoneNumber)
* [Notification](#Notification)
* [PhoneVerificationData](#PhoneVerificationData)
* [Registration](#Registration)
* [RegistrationData](#RegistrationData)
* [RegistrationInformationData](#RegistrationInformationData)
* [RegistrationState](#RegistrationState)
* [CheckRegistrationData](#CheckRegistrationData)
* [ResendPhoneVerificationCodeData](#ResendPhoneVerificationCodeData)
* [ResendVerificationCode](#ResendVerificationCode)
* [RequestDataError](#RequestDataError)
* [RequestError](#RequestError)
* [RootConfiguration](#RootConfiguration)
* [RegistrationEndpoint](#RegistrationEndpoint)
* [CountryRegistrationEndpoint](#CountryRegistrationEndpoint)
* [Settings](#Settings)
* [SettingsInvalidError](#SettingsInvalidError)
* [Service](#Service)
* [EmergencyService](#EmergencyService)
* [Message](#Message)
* [Category](#Category)
* [DefaultMessages](#DefaultMessages)
* [SilentMessages](#SilentMessages)

## Prerequisites

* Valid API Key
* Registration service URL

## Usage

Be aware that the import syntax depends on the environment you are using

### Registration Client

#### Initializing the registration client

```javascript
import { DEC112RegistrationClient, Settings } from '@meecode/ng112-reg-js/dist/node';

const registrationServer = 'https://your-registration-server-url/api/apiVersion';
const apiKey = 'yourApiKey';

const settings: Settings = new Settings(registrationServer, apiKey);
const instance = new DEC112RegistrationClient(settings);
```

#### Register a device

Follow these steps to register a device:

| Parameter                                                                                        | Required      |
|--------------------------------------------------------------------------------------------------|---------------|
| [Get root configuration and choose the appropriate registration endpoint](#GetRootConfiguration) | yes           |
| [Normalize phone number](#NormalizePhoneNumber)                                                  | yes           |
| [Register device](#Register)                                                                     | yes           |
| [Send verification code](#VerifyPhoneNumber)                                                     | yes           |
| [Resend verification code](#ResendVerificationCode)                                              | no (Optional) |
| [Get configuration when verification was successful](#GetConfiguration)                          | yes           |
| Test configuration                                                                               | no (Optional) |

The registrationId is very important and needs to be stored in order to send other queries. There is no possibility on
recover a lost registrationId.

```javascript
import { RegistrationData, Registration } from '@meecode/ng112-reg-js/dist/node';

const registrationServer = 'https://your-registration-server-url/api/apiVersion';
const apiKey = 'yourApiKey';
const settings: Settings = new Settings(registrationServer, apiKey);
const instance = new DEC112RegistrationClient(settings);

const normalizePhoneNumberData = new NormalizePhoneNumberData('066412345678', '0042');
const response = await instance.normalizePhoneNumber(normalizePhoneNumberData);

const registrationData = new RegistrationData('iPhone XS', 'en', response.normalizedPhoneNumber);
const registrationResponse = await instance.register(registrationData);

const phoneVerificationData = new PhoneVerificationData("4444-1111", registrationResponse.registrationId);
const verifyPhoneResponse = await instance.verifyPhoneNumber(phoneVerificationData);

const registrationInformationData = new RegistrationInformationData(registrationResponse.registrationId);
const deviceConfiguration = await instance.getConfiguration();


```

#### Error Handling

Every method returns [`Readonly<RequestError>`](#RequestError) in case one or more errors occur.

```javascript
import { RegistrationData, Registration } from '@meecode/ng112-reg-js/dist/node';

const registrationServer = 'https://your-registration-server-url/api/apiVersion';
const apiKey = 'yourApiKey';
const settings: Settings = new Settings(registrationServer, apiKey);
const instance = new DEC112RegistrationClient(settings);

const registrationData = new RegistrationData('iPhone XS', 'en', '000011112222');
const registrationResponse = instance.register(registrationData)
    .catch((error: Readonly<RequestError>) => {
        //TODO: implement
    });
```

### Usage in combination with [ng112-js](https://github.com/dec112/ng112-js) SDK

#### Query the app configuration after successful registration

```javascript
import {
    Agent,
    DEC112Specifics,
} from 'ng112-js/dist/node';

const registrationServer = 'https://your-registration-server-url/api/apiVersion';
const apiKey = 'yourApiKey';
const settings: Settings = new Settings(registrationServer, apiKey);
const instance = new DEC112RegistrationClient(settings);
const registrationInformationData = new RegistrationInformationData('registrationId');

const configuration = await instance.getConfiguration(registrationInformationData);

const agenConfiguration = {
    endpoint: configuration.server,
    domain: configuration.realm,
    user: configuration.privateId,
    password: configuration.password,
    displayName: 'Your display name',
    namespaceSpecifics: new DEC112Specifics(undefined, configuration.registrationId, 'your language')
};
const agent = new Agent(agenConfiguration);

// Choose the appropriate service from the array of available services and use the sip property as conversation partner
const conversationPartner = configuration.services.default[0].sip;

agent.createConversation(conversationPartner);
```

## Methods & Properties

### DEC112RegistrationClient

The `DEC112RegistrationClient` is used to communicate with the corresponding registration service.

#### Constructor

`constructor(settings)`

| Parameter | Type                    | Default | Required | Description                               |
|-----------|-------------------------|---------|----------|-------------------------------------------|
| settings  | [`Settings`](#Settings) | `null`  | yes      | Settings used for initializing the client |

#### UpdateRegistrationServer

Update the registration server

`updateRegistrationServer(registrationServer)`

| Parameter          | Type     | Default | Required | Description  |
|--------------------|----------|---------|----------|--------------|
| registrationServer | `string` | `null`  | yes      |              |

#### GetConfiguration

Get the configuration for an already existing registration. The configuration can change, so it is recommended to check
periodically if the configuration has changed.

`getConfiguration(registrationInfo)`

| Parameter               | Type                                                          | Default | Required | Description  |
|-------------------------|---------------------------------------------------------------|---------|----------|--------------|
| registrationInformation | [`RegistrationInformationData`](#RegistrationInformationData) | `null`  | yes      |              |

Returns a Promise which resolves with [`Readonly<AppConfiguration>`](#AppConfiguration) when successful and rejects
with [`Readonly<RequestError>`](#RequestError) when an error occurred.

#### GetRootConfiguration

The root configuration provides a list of DEC112 registries and other resources (e.g. language resources). Select the
registry which should be used for the registration process.

`getRootConfiguration()`

No parameters required.

Returns a Promise which resolves with [`Readonly<RootConfiguration>`](#RootConfiguration) when successful and rejects
with [`Readonly<RequestError>`](#RequestError) when an error occurred.

#### NormalizePhoneNumber

`normalizePhoneNumber(phoneNumberData)`

| Parameter        | Type                                                     | Default | Required  | Description   |
|------------------|----------------------------------------------------------|---------|-----------|---------------|
| phoneNumberData  | [`NormalizePhoneNumberData`](#NormalizePhoneNumberData)  | `null`  | true      |               |

Returns a Promise which resolves with [`Readonly<NormalizedPhoneNumber>`](#NormalizedPhoneNumber) when
successful and rejects with [`Readonly<RequestError>`](#RequestError) when an error occurred.

#### Register

Register a new user with the given registration information.

`register(registrationData)`

| Parameter        | Type                                    | Default | Required | Description  |
|------------------|-----------------------------------------|---------|----------|--------------|
| registrationData | [`RegistrationData`](#RegistrationData) | `null`  | yes      |

Returns a Promise which resolves with [`Readonly<Registration>`](#Registration) when successful and rejects
with [`Readonly<RequestError>`](#RequestError) when an error occurred.

#### CheckRegistration

Check the registration data of an existing registration. Can also be used to check the registration state (e.g.:
pending, ...)

Returns a Promise which resolves with [`Readonly<Registration>`](#Registration) when successful and rejects
with [`Readonly<RequestError>`](#RequestError) when an error occurred.

#### ResendPhoneVerificationCode

Allows resending a possibly lost phone verification SMS code up to two times.

`resendPhoneVerificationCode(rendCodeData)`

| Parameter      | Type                                                                   | Default | Required | Description  |
|----------------|------------------------------------------------------------------------|---------|----------|--------------|
| resendCodeData | [`ResendPhoneVerificationCodeData`](#ResendPhoneVerificationCodeData)  | `null`  | true     |              |

Returns a Promise which resolves with [`Readonly<ResendVerificationCode>`](#ResendVerificationCode) when successful and
rejects with [`Readonly<RequestError>`](#RequestError) when an error occurred.

#### Unregister

Deletes an existing Registration.

`unregister(deleteRegistrationData)`

| Parameter              | Type                                                | Default | Required | Description  |
|------------------------|-----------------------------------------------------|---------|----------|--------------|
| deleteRegistrationData | [`DeleteRegistrationData`](#DeleteRegistrationData) | `null`  | true     |              |

Returns a Promise which resolves with [`Readonly<DeleteRegistration>`](#DeleteRegistration) when successful and rejects
with [`Readonly<RequestError>`](#RequestError) when an error occurred.

#### VerifyPhoneNumber

Verifies a registrations phone number.

`verifyPhoneNumber(verificationData)`

| Parameter        | Type                                              | Default | Required | Description  |
|------------------|---------------------------------------------------|---------|----------|--------------|
| verificationData | [`PhoneVerificationData`](#PhoneVerificationData) | `null`  | true     |              |

Returns a Promise which resolves with [`Readonly<Registration>`](#Registration) when successful and rejects
with [`Readonly<RequestError>`](#RequestError) when an error occurred.

#### EnableDebug

Enables the debug mode which outputs also debug statements to the console.

`enableDebug(true)`

| Parameter | Type    | Default | Required | Description  |
|-----------|---------|---------|----------|--------------|
| enabled   | boolean | `null`  | true     |              |

#### IsDebugEnabled

Checks whether the debug mode is enabled or not.

`isDebugEnabled()`

### PhoneVerificationData

| Property         | Type     | Default | Required | Description  |
|------------------|----------|---------|----------|--------------|
| verificationCode | `string` | `null`  | yes      |              |
| registrationId   | `string` | `null`  | yes      |              |

### RegistrationData

| Property    | Type     | Default | Required | Description  |
|-------------|----------|---------|----------|--------------|
| model       | `string` | `null`  | no       |              |
| language    | `string` | `null`  | yes      |              |
| phoneNumber | `string` | `null`  | yes      |              |

### SaveRegistrationData

| Property       | Type     | Default | Required | Description  |
|----------------|----------|---------|----------|--------------|
| registrationId | `string` | `null`  | yes      |              |
| phoneNumber    | `string` | `null`  | yes      |              |
| data           | `object` | `null`  | yes      |              |

### RegistrationInformationData

| Property       | Type     | Default | Required | Description                                                                     |
|----------------|----------|---------|----------|---------------------------------------------------------------------------------|
| registrationId | `string` | `null`  | yes      | The registration id of the device which the configuration should be queried for |

### DeleteRegistrationData

| Property       | Type     | Default | Required | Description  |
|----------------|----------| --- |----------|--------------|
| registrationId | `string` | `null` | yes      |              |
| phoneNumber    | `string` | `null` | yes      |              |

### RequestDataError

| Property | Type | Default | Required | Description  |
|----------|------|---------|----------|--------------|

### Registration

| Property                   | Type                                      | Description  |
|----------------------------|-------------------------------------------|--------------|
| registrationId             | `string`                                  |              |
| language                   | `string`                                  |              |
| state                      | [`RegistrationState`](#RegistrationState) |              |
| phoneVerificationTimeStamp | `string`                                  |              |
| phonePrivacy               | `string`                                  |              |
| registrationTimeStamp      | `string`                                  |              |

### DeleteRegistration

| Property       | Type     | Description  |
|----------------|----------|--------------|
| registrationId | `string` |              |

### AppConfiguration

Response of [`getConfiguration`](#GetConfiguration) request

| Property       | Type                          | Description  |
|----------------|-------------------------------|--------------|
| registrationId | `string`                      |              |
| server         | `string`                      |              |
| publicId       | `string`                      |              |
| privateId      | `string`                      |              |
| password       | `string`                      |              |
| realm          | `string`                      |              |
| services       | [`AppServices`](#AppServices) |              |

### AppServices

| Property | Type                | Description                                                                           |
|----------|---------------------|---------------------------------------------------------------------------------------|
| service  | `Service`           | A [Service](#Service) element containing all available emergency services information |
| app      | `App`               | A list of [AppService](#App) elements used for test emergency calls                   |

### RootConfiguration

| Property                 | Type                                                                 | Description  |
|--------------------------|----------------------------------------------------------------------|--------------|
| countryRegistryEndpoints | [`Array<CountryRegistrationEndpoint>`](#CountryRegistrationEndpoint) |              |

### Settings

| Property           | Type     | Default  | Required | Description                       |
|--------------------|----------|----------|----------|-----------------------------------|
| registrationServer | `string` | `null`   | yes      |                                   |
| apiKey             | `string` | `string` | yes      | The api key used for verification |

### SettingsInvalidError

| Property | Type                                           | Default | Required | Description  |
|----------|------------------------------------------------|---------|----------|--------------|
| errors   | [`Array<RequestDataError>`](#RequestDataError) | `null`  | yes      |              |

### NormalizePhoneNumberData

| Property          | Type     | Default | Required | Description                      |
|-------------------|----------|---------|----------|----------------------------------|
| phoneNumber       | `string` | `null`  | yes      |                                  |
| phoneNumberPrefix | `string` | `null`  | yes      | The prefix for the phone number. | 0043 |

### NormalizedPhoneNumber

| Property              | Type     | Default | Required | Description  | Example(s) |
|-----------------------|----------|---------|----------|--------------|------------|
| phoneNumber           | `string` | `null`  | true     |              |
| normalizedPhoneNumber | `string` | `null`  | true     |              |
| code                  | `string` | `null`  | true     |              |

### CheckRegistrationData

| Property       | Type     | Default | Required | Description  | Example(s) |
|----------------|----------|---------|----------|--------------|------------|
| registrationId | `string` | `null`  | true     |              |

### ResendPhoneVerificationCodeData

Response of [ResendPhoneVerificationCode](#ResendPhoneVerificationCode) request.

| Property       | Type     | Description  |
|----------------|----------|--------------|
| registrationId | `string` |              |  

### ResendVerificationCode

Request data for the [ResendPhoneVerificationCode](#ResendPhoneVerificationCode) request.

| Property       | Type     | Default | Required | Description  |
|----------------|----------|---------|----------|--------------|
| registrationId | `string` | `null`  | yes      |

### RegistrationEndpoint

| Property | Type     | Description  |
|----------|----------|--------------|
| type     | `string` |              |
| baseUrl  | `string` |              |

### CountryRegistrationEndpoint

| Property              | Type                                                   | Description  |
|-----------------------|--------------------------------------------------------|--------------|
| name                  | `string`                                               |              | 
| registrationEndpoints | [`Array<RegistrationEndpoint>`](#RegistrationEndpoint) |              |

### RequestError

| Property   | Type     | Description  |
|------------|----------|--------------|
| message    | `string` |              |  
| value      | `string` |              |  
| identifier | `string` |              |

### RegistrationState

Enum for the different registration states. Every value between 2 - 8 means ongoing verification process.

| Value               | Integer Value | Description |
|---------------------|---------------|-------------|
| notRegistered       | 0             |             |
| pendingRegistration | 1             |             |
| registrationError   | 9             |             |
| registered          | 10            |             |

### Service

Emergency service configuration

| Property  | Type                      | Description                                           |
|-----------|---------------------------|-------------------------------------------------------|
| services  | `Array<EmergencyService>` | A list of [EmergencyService](#EmergencyService) items |  
| message   | `Message`                 | A [Message](#Message) object                          |
| category  | `Category`                | A [Message](#Category) object                         |

### EmergencyService

| Property   | Type            | Description                                              |
|------------|-----------------|----------------------------------------------------------|
| in         | `string`        | Unique id for the server                                 |  
| enabled    | `boolean`       | A value indicating whether the service is enabled or not |
| title      | `Translations`  | A [Translations](#Translations) object                   |
| category   | `string`        |                                                          |
| urn        | `string`        |                                                          |
| sip        | `string`        |                                                          |
| icon       | `string`        |                                                          |
| type       | `string`        |                                                          |
| titleShort | `Translations`  | A [Translations](#Translations) object                   |

### Message

| Property        | Type              | Description                                       |
|-----------------|-------------------|---------------------------------------------------|
| defaultMessages | `DefaultMessages` | A [DefaultMessages](#DefaultMessages) object      |  
| silentMessages  | `SilentMessages`  | A [SilentMessages](#SilentMessages) object        | 

### Category

| Property  | Type                | Description                                      |
|-----------|---------------------|--------------------------------------------------|
| emergency | `EmergencyCategory` | A [EmergencyCategory](#EmergencyCategory) object |  
| test      | `TestCategory`      | A [TestCategory](#TestCategory) object           |  


### DefaultMessages

| Property   | Type            | Description                                                                                           |
|------------|-----------------|-------------------------------------------------------------------------------------------------------|
| start      | `Translations`  | The start message for an emergency call. A [Translation](#Translations) object                        |  
| stop       | `Translations`  | The stop message for an emergency call. A [Translation](#Translations) object                         |  
| background | `Translations`  | The message when the device is sent to background. A [Translation](#Translations) object              |  
| foreground | `Translations`  | The message when the device is sent to foreground. A [Translation](#Translations) object              |  
| internal   | `Translations`  | An internal message not intended to be sent to the call center. A [Translation](#Translations) object |  

### SilentMessages

| Property  | Type            | Description                                                                           |
|-----------|-----------------|---------------------------------------------------------------------------------------|
| start     | `Translations`  | The start message for a silent emergency call. A [Translation](#Translations) object  |  

### EmergencyCategory

| Property | Type           | Description                           |
|----------|----------------|---------------------------------------|
| title    | `Translations` | A [Translation](#Translations) object |  

### TestCategory

| Property | Type           | Description                           |
|----------|----------------|---------------------------------------|
| title    | `Translations` | A [Translation](#Translations) object |  

### Translations

Translations object

| Property | Type     | Description               |
|----------|----------|---------------------------|
| en       | `string` | English translation text  |  
| de       | `string` | German translation text   |

### App

App specific configuration

| Property        | Type           | Description                          |
|-----------------|----------------|--------------------------------------|
| notification    | `Notification` | [Notification](#Notification) object |  
| environmentType | `string`       | Current values: DEC112 or undefined  |

### Notification

Notification specific configuration

| Property      | Type     | Description |
|---------------|----------|-------------|
| appIdentifier | `string` |             |

### InAppSearch


| Property       | Type                     | Description |
|----------------|--------------------------|-------------|
| emergencyCalls | `Array<InAppSearchItem>` |             |

### InAppSearchItem

| Property    | Type                 | Description |
|-------------|----------------------|-------------|
| id          | `string`             |             |
| title       | `Translation`        |             | 
| description | `Translation`        |             | 
| domain      | `string`             |             | 
| keywords    | `Array<Translation>` |             | 

## Author

[MeeCode by Mario Murrent](https://www.meecode.at)

## Special Thanks

For supporting the development:

[Gebsl](https://github.com/gebsl)

## License

UNLICENSED

## Copyright

Copyright © 2021 - 2022, [MeeCode by Mario Murrent](https://www.meecode.at). All Rights Reserved.

## CI Status

![Node.js CI](https://github.com/mariomurrent-softwaresolutions/ng112-reg-js/workflows/Node.js%20CI/badge.svg)

---
_Source: https://npm.io/package/@meecode/ng112-reg-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
