Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@corbado/web-core

Package Overview
Dependencies
Maintainers
5
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@corbado/web-core - npm Package Compare versions

Comparing version 0.1.7-alpha.3 to 0.1.7-alpha.4

dist/utils/helpers/getEmailLinkToken.d.ts

12

dist/services/ApiService.d.ts

@@ -1,3 +0,3 @@

import type { PassKeyList } from '@corbado/types';
import type { ProjectConfig, UserAuthMethods } from '@corbado/types';
import type { PassKeyList, UserIdentifier } from '@corbado/types';
import type { Subject } from 'rxjs';

@@ -7,3 +7,3 @@ import { Result } from 'ts-results';

import { AuthenticationResponse } from '../models/auth';
import type { AppendPasskeyError, AuthMethodsListError, CompleteLoginWithEmailOTPError, CompleteSignupWithEmailOTPError, GetProjectConfigError, InitAutocompletedLoginWithPasskeyError, InitLoginWithEmailOTPError, InitSignUpWithEmailOTPError, LoginWithPasskeyError, PasskeyDeleteError, PasskeyListError, SignUpWithPasskeyError } from '../utils';
import type { AppendPasskeyError, AuthMethodsListError, CompleteLoginWithEmailLinkError, CompleteLoginWithEmailOTPError, CompleteSignupWithEmailLinkError, CompleteSignupWithEmailOTPError, GetProjectConfigError, InitAutocompletedLoginWithPasskeyError, InitLoginWithEmailLinkError, InitLoginWithEmailOTPError, InitSignUpWithEmailLinkError, InitSignUpWithEmailOTPError, LoginWithPasskeyError, PasskeyDeleteError, PasskeyListError, SignUpWithPasskeyError, UserExistsError } from '../utils';
import { NonRecoverableError } from '../utils';

@@ -21,6 +21,8 @@ /**

* It initializes the API instances with a short term session token, if available.
* @param globalErrors Subscribe to this subject to receive global errors that can not be handled by the component)
* @param projectId The project ID for the current application instance.
* @param timeout Optional timeout for API requests, defaulting to 30 seconds.
* @param frontendApiUrl Optional URL for the frontend API, defaulting to https://<projectId>.frontendapi.corbado.io.
*/
constructor(globalErrors: Subject<NonRecoverableError | undefined>, projectId: string, timeout?: number);
constructor(globalErrors: Subject<NonRecoverableError | undefined>, projectId: string, timeout?: number, frontendApiUrl?: string);
get usersApi(): UsersApi;

@@ -45,2 +47,5 @@ get assetsApi(): AssetsApi;

emailCodeConfirm(emailCodeId: string, otpCode: string): Promise<Result<AuthenticationResponse, CompleteSignupWithEmailOTPError | CompleteLoginWithEmailOTPError | undefined>>;
emailLinkRegisterStart(email: string, username: string): Promise<Result<string, InitSignUpWithEmailLinkError | undefined>>;
emailLinkLoginStart(email: string): Promise<Result<string, InitLoginWithEmailLinkError | undefined>>;
emailLinkConfirm(emailLinkID: string, token: string): Promise<Result<AuthenticationResponse, CompleteSignupWithEmailLinkError | CompleteLoginWithEmailLinkError | undefined>>;
authMethodsList(email: string): Promise<Result<UserAuthMethods, AuthMethodsListError | undefined>>;

@@ -50,2 +55,3 @@ getProjectConfig(): Promise<Result<ProjectConfig, GetProjectConfigError | undefined>>;

passkeyDelete(passkeyId: string): Promise<Result<void, PasskeyDeleteError>>;
userExists(userIdentifierType: UserIdentifier, identifier: string): Promise<Result<boolean, UserExistsError | undefined>>;
}
import type { SessionUser } from '@corbado/types';
import { BehaviorSubject } from 'rxjs';
import type { Result } from 'ts-results';
import type { AppendPasskeyError, CompleteLoginWithEmailOTPError, CompleteSignupWithEmailOTPError, InitLoginWithEmailOTPError, InitSignUpWithEmailOTPError, LoginWithPasskeyError, RecoverableError, SignUpWithPasskeyError } from '../utils';
import type { AppendPasskeyError, CompleteLoginWithEmailLinkError, CompleteLoginWithEmailOTPError, CompleteSignupWithEmailLinkError, CompleteSignupWithEmailOTPError, InitLoginWithEmailLinkError, InitLoginWithEmailOTPError, InitSignUpWithEmailLinkError, InitSignUpWithEmailOTPError, LoginWithPasskeyError, RecoverableError, SignUpWithPasskeyError } from '../utils';
import { AuthState } from '../utils';

@@ -21,3 +21,2 @@ import type { ApiService } from './ApiService';

constructor(apiService: ApiService, sessionService: SessionService, webAuthnService: WebAuthnService);
init(isDebug?: boolean): void;
/**

@@ -35,2 +34,3 @@ * Exposes changes to the user object

get authStateChanges(): BehaviorSubject<AuthState>;
init(isDebug: boolean | undefined, useSessionManagement: boolean): void;
/**

@@ -41,2 +41,13 @@ * Method to start registration of a user by sending an email with an OTP.

/**
* Completes an ongoing email OTP signUp flow.
* Afterward, the user is logged in.
*
* @param otp 6-digit OTP code that was sent to the user's email
*/
completeSignupWithEmailOTP(otp: string): Promise<Result<void, CompleteSignupWithEmailOTPError | undefined>>;
/**
* Method to log in with an email OTP.
*/
initLoginWithEmailOTP(email: string): Promise<Result<void, InitLoginWithEmailOTPError | undefined>>;
/**
* Completes an ongoing email OTP login flow.

@@ -49,9 +60,24 @@ * Afterward, the user is logged in.

/**
* Completes an ongoing email OTP signUp flow.
* Method to start registration of a user by sending an email with a link.
*/
initSignUpWithEmailLink(email: string, username: string): Promise<Result<void, InitSignUpWithEmailLinkError | undefined>>;
/**
* Completes an ongoing email link signUp flow.
* Afterward, the user is logged in.
*
* @param otp 6-digit OTP code that was sent to the user's email
* @param token token that was sent to the user's email
*/
completeSignupWithEmailOTP(otp: string): Promise<Result<void, CompleteSignupWithEmailOTPError | undefined>>;
completeSignupWithEmailLink(): Promise<Result<void, CompleteSignupWithEmailLinkError | undefined>>;
/**
* Method to log in with an email link.
*/
initLoginWithEmailLink(email: string): Promise<Result<void, InitLoginWithEmailLinkError | undefined>>;
/**
* Completes an ongoing email link login flow.
* Afterward, the user is logged in.
*
* @param token token that was sent to the user's email
*/
completeLoginWithEmailLink(): Promise<Result<void, CompleteLoginWithEmailLinkError | undefined>>;
/**
* Creates a new user with a passkey.

@@ -64,2 +90,9 @@ *

/**
* Method to log in with a passkey.
*
* @param email
*/
loginWithPasskey(email: string): Promise<Result<void, LoginWithPasskeyError | undefined>>;
loginWithConditionalUI(): Promise<Result<void, LoginWithPasskeyError | undefined>>;
/**
* Method to append a passkey.

@@ -69,14 +102,4 @@ * User needs to be logged in to use this method.

appendPasskey(): Promise<Result<void, AppendPasskeyError | undefined>>;
/**
* Method to log in with a passkey.
* If conditional is true, conditional UI will be invoked.
*/
loginWithPasskey(email: string): Promise<Result<void, LoginWithPasskeyError | undefined>>;
loginWithConditionalUI(): Promise<Result<void, LoginWithPasskeyError | undefined>>;
passkeyList(): Promise<Result<import("@corbado/types").PassKeyList, import("../utils").UnknownError>>;
passkeyDelete(id: string): Promise<Result<void, import("../utils").UnknownError>>;
/**
* Method to log in with an email OTP.
*/
initLoginWithEmailOTP(email: string): Promise<Result<void, InitLoginWithEmailOTPError | undefined>>;
authMethods(email: string): Promise<Result<import("@corbado/types").UserAuthMethods, import("../utils").AuthMethodsListError | undefined>>;

@@ -83,0 +106,0 @@ userExists(email: string): Promise<Result<boolean, RecoverableError | undefined>>;

import type { AxiosError } from 'axios';
/** General Errors */
export type AuthMethodsListError = UnknownUserError | UnknownError;
export type GetProjectConfigError = UnknownError;
/** Passkey Authentication Errors */
export type SignUpWithPasskeyError = UserAlreadyExistsError | InvalidEmailError | InvalidFullnameError | PasskeyChallengeCancelledError | UnknownError;
export type AppendPasskeyError = PasskeyChallengeCancelledError | UnknownError;
export type LoginWithPasskeyError = InvalidEmailError | InvalidPasskeyError | PasskeyChallengeCancelledError | UnknownError;
export type LoginWithPasskeyError = InvalidEmailError | InvalidPasskeyError | PasskeyChallengeCancelledError | InitAutocompletedLoginWithPasskeyError | ConditionalUiNotSupportedError | UnknownError;
export type InitAutocompletedLoginWithPasskeyError = UnknownError;
export type CompleteAutocompletedLoginWithPasskeyError = InvalidPasskeyError | PasskeyChallengeCancelledError | UnknownError;
/** Email OTP Errors */
export type InitSignUpWithEmailOTPError = InvalidEmailError | UserAlreadyExistsError | UnknownError;
export type CompleteSignupWithEmailOTPError = InvalidOtpInputError | UnknownError;
export type InitLoginWithEmailOTPError = InvalidEmailError | UnknownError;
export type CompleteLoginWithEmailOTPError = InvalidEmailError | UnknownError;
export type AuthMethodsListError = UnknownUserError | UnknownError;
export type GetProjectConfigError = UnknownError;
export type CompleteLoginWithEmailOTPError = InvalidOtpInputError | UnknownError;
/** Email Link Errors */
export type InitSignUpWithEmailLinkError = InvalidEmailError | UserAlreadyExistsError | UnknownError;
export type CompleteSignupWithEmailLinkError = InvalidTokenInputError | UnknownError;
export type InitLoginWithEmailLinkError = InvalidEmailError | UnknownError;
export type CompleteLoginWithEmailLinkError = InvalidTokenInputError | UnknownError;
/** Passkey Management Errors */
export type PasskeyListError = UnknownError;
export type PasskeyDeleteError = UnknownError;
export type UserExistsError = UnknownError;
export declare class CorbadoError extends Error {

@@ -81,4 +91,10 @@ #private;

}
export declare class InvalidTokenInputError extends RecoverableError {
constructor();
}
export declare class ConditionalUiNotSupportedError extends RecoverableError {
constructor();
}
export declare class UnknownError extends RecoverableError {
constructor();
}
export * from './constants';
export * from './errors';
export * from './helpers';
{
"name": "@corbado/web-core",
"version": "0.1.7-alpha.3",
"version": "0.1.7-alpha.4",
"description": "This package contains core functionalities which are exported by all the SDKs and UI packages of our JavaScript library",

@@ -43,5 +43,5 @@ "author": "Abdullah Shahbaz <abdullah_ghani@live.com>",

"devDependencies": {
"@corbado/types": "^0.1.1-alpha.3"
"@corbado/types": "^0.1.1-alpha.4"
},
"gitHead": "746086968c769513b83f2c62d3ba4a6488425c92"
"gitHead": "3bd63094494204828688170d7461932d5786de53"
}

@@ -1,16 +0,28 @@

# `web-core`
<img width="1070" alt="GitHub Repo Cover" src="https://github.com/corbado/corbado-php/assets/18458907/aa4f9df6-980b-4b24-bb2f-d71c0f480971">
This package contains core functionalities which are exported by all the SDKs and UI packages of our JavaScript library.
# @corbado/web-core
## Note: Package is for internal use only.
[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/corbado/javascript/blob/readme_documentation/LICENSE)
[![Documentation](https://img.shields.io/badge/documentation-available-brightgreen)](https://docs.corbado.com/overview/welcome)
[![Slack](https://img.shields.io/badge/slack-community-blueviolet)](https://join.slack.com/t/corbado/shared_invite/zt-1b7867yz8-V~Xr~ngmSGbt7IA~g16ZsQ)
[![npm version](https://img.shields.io/npm/v/@corbado/web-core)](https://www.npmjs.com/package/@corbado/web-core)
> TODO: Add more details about the package here.
---
> TODO: Publish the package to npm.
## Overview
## Noticeable concepts
This package contains core functionalities which are used by all the SDKs and UI packages of the `@corbado` JavaScript library.
Since, this is an internal package, it is not needed to be installed separately.
- SessionService should not be exposed to other packages (it should be encapsulated by AuthService)
- LongSession should be completely encapsulated by SessionService
- Functions should be pure if possible
- Functions should not be influenced by UI problems (UI problems should be solved in UI packages) => the only place that deals with UI problems is the FlowHandlerService
---
## 📄 Documentation & Support
For support and questions please visit our [Slack channel](https://join.slack.com/t/corbado/shared_invite/zt-1b7867yz8-V~Xr~ngmSGbt7IA~g16ZsQ).
For more detailed information and advanced configuration options, please visit our [Documentation Page](https://docs.corbado.com/overview/welcome).
---
## 🔒 License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/corbado/javascript/blob/readme_documentation/LICENSE) file for details.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc