Appkey Web SDK API Reference
API Registration Reference
Handles user registration with customizable localization and translation options.
registration(options: IRegistration): Promise<IResponse>Types and Interfaces
Localization
Available localization
Localization Enum:
| Key | Value | |
|---|---|---|
| AR | ar | Arabic |
| DE | de | German |
| EN | en | English |
| ES | es | Spanish |
| FR | fr | French |
| GA | ga | Gaelic |
| HE | he | Hebrew |
| IT | it | Italian |
| JA | ja | Japanese |
| NL | nl | Dutch |
| PT | pt | Portuguese |
| RO | ro | Romanian |
14
enum ELocalization { AR = 'ar', DE = 'de', EN = 'en', ES = 'es', FR = 'fr', GA = 'ga', HE = 'he', IT = 'it', JA = 'ja', NL = 'nl', PT = 'pt', RO = 'ro'}Translation Keys
Available translation keys for UI text:
Translation Key Enum:
| Key | Value |
|---|---|
| REGISTRATION_TITLE | registration.title |
| REGISTRATION_SUBTITLE | registration.subTitle |
| REGISTRATION_DESCRIPTION | registration.description |
| REGISTRATION_CANCEL | registration.cancel |
| AUTHENTICATION_TITLE | authentication.title |
| AUTHENTICATION_SUBTITLE | authentication.subTitle |
| AUTHENTICATION_DESCRIPTION | authentication.description |
| AUTHENTICATION_CANCEL | authentication.cancel |
10
enum ETranslationKey { REGISTRATION_TITLE = 'registration.title', REGISTRATION_SUBTITLE = 'registration.subTitle', REGISTRATION_DESCRIPTION = 'registration.description', REGISTRATION_CANCEL = 'registration.cancel', AUTHENTICATION_TITLE = 'authentication.title', AUTHENTICATION_SUBTITLE = 'authentication.subTitle', AUTHENTICATION_DESCRIPTION = 'authentication.description', AUTHENTICATION_CANCEL = 'authentication.cancel'}Type Definition
TLangTranslations
| Key (ETranslationKey) | Value (string) |
|---|---|
| registration.title | string |
| registration.subTitle | string |
| registration.description | string |
| registration.cancel | string |
| authentication.title | string |
| authentication.subTitle | string |
| authentication.description | string |
| authentication.cancel | string |
TTranslations
| Key (ELocalization) | Value (TLangTranslations) |
|---|---|
| ar | TLangTranslations |
| de | TLangTranslations |
| en | TLangTranslations |
| ... | ... |
x
type TLangTranslations = { [K in ETranslationKey]: string}type TTranslations = { [L in ELocalization]?: TLangTranslations}interface IRegistration { appkeyRegClientRequest?: string; // Base64 encoded registration request language?: ELocalization; // Language code for localization translations?: TTranslations; // Translation object}IRegistration
| Property | Type | Description |
|---|---|---|
| appkeyRegClientRequest | string | Base64 encoded registration request |
| language | ELocalization | Language code for localization |
| translations | TTranslations | Translation object |
interface IResponseSuccess { success: true; data: string;}IResponseSuccess
| Property | Type | Description |
|---|---|---|
| success | true | Indicates success |
| data | string | Response data |
interface IResponseError { success: false; data: string; error: { errorCode: number; errorMessage: string; };}IResponseError
| Property | Type | Description |
|---|---|---|
| success | true | Indicates success |
| data | string | Response data |
| error | object | Error details |
| errorCode | number | Error code |
| errorMessage | string | Error message |
type IResponse = IResponseSuccess | IResponseError;Registration Response Success Example
{ success: true, data:{ appkeyAuthBrowserResponse: "{\"clientResponseMessage\":\"[{\\\"assertions\\\":[{\\\"assertion\\\":\\\"...." }}Error Codes and Messages
| Error Code | Message |
|---|---|
| 5 | There is no registered user in the browser. |
| 100001 | There is already a registered user in the browser. |
| 100002 | Unknown error occurred |
| 100003 | Unknown error occurred |
| 100004 | Fido request not valid. |
| 100005 | There is no authenticators. |
| 100006 | Transaction cancel. |
10
{ success: false, data:{ appkeyAuthBrowserResponse: "{\"clientError\":{\"errorCode\":3,\"errorMessage\":\"uaf_error_user_cancelled\"}}" }, error: { errorCode: 3, errorMessage: "The user cancelled the action." }}API Authentication Reference
Handles user authentication with customizable localization, translation and transactionCallback options.
authentication(options: IAuthentication): Promise<IResponse>IAuthentication
| Property | Type | Description |
|---|---|---|
| appkeyAuthClientRequest | string | Base64 encoded authentication request |
| language | ELocalization | Language code for localization |
| translations | TTranslations | Translation object |
| transactionCallback | (transactionText) => Promise<true> | false |
30
type TLangTranslations = { [K in ETranslationKey]: string}type TTranslations = { [L in ELocalization]?: TLangTranslations}interface IAuthentication { appkeyAuthClientRequest?: string; language?: ELocalization; translations?: TTranslations; transactionCallback?: (transactionText) => Promise<true | false>;}interface IResponseSuccess { success: true; data: string;}interface IResponseError { success: false; data: string; error: { errorCode: number; errorMessage: string; };}type IResponse = IResponseSuccess | IResponseError;Authentication Response Success Example
{ success: true, data: { appkeyAuthBrowserResponse: "{\"clientResponseMessage\":\"[{\\\"assertions\\\":..." }}