Event Types

Event Types

AccountRegistrationEvent

This event is fired when a new user registers an account, either as a stand-alone signup or after placing an order.

Signature

class AccountRegistrationEvent extends VendureEvent {
  constructor(ctx: RequestContext, user: User)
}

Members

constructor

method
type:
(ctx: RequestContext, user: User) => AccountRegistrationEvent

AttemptedLoginEvent

This event is fired when an attempt is made to log in via the shop or admin API login mutation.

Signature

class AttemptedLoginEvent extends VendureEvent {
  constructor(ctx: RequestContext, identifier: string)
}

Members

constructor

method
type:
(ctx: RequestContext, identifier: string) => AttemptedLoginEvent

CollectionModificationEvent

This event is fired whenever a Collection is modified in some way. The productVariantIds argument is an array of ids of all ProductVariants which:

  1. were part of this collection prior to modification and are no longer
  2. are now part of this collection after modification but were not before

Signature

class CollectionModificationEvent extends VendureEvent {
  constructor(ctx: RequestContext, collection: Collection, productVariantIds: ID[])
}

Members

constructor

method
type:
(ctx: RequestContext, collection: Collection, productVariantIds: ID[]) => CollectionModificationEvent

IdentifierChangeEvent

This event is fired when a registered user successfully changes the identifier (ie email address) associated with their account.

Signature

class IdentifierChangeEvent extends VendureEvent {
  constructor(ctx: RequestContext, user: User, oldIdentifier: string)
}

Members

constructor

method
type:
(ctx: RequestContext, user: User, oldIdentifier: string) => IdentifierChangeEvent

IdentifierChangeRequestEvent

This event is fired when a registered user requests to update the identifier (ie email address) associated with the account.

Signature

class IdentifierChangeRequestEvent extends VendureEvent {
  constructor(ctx: RequestContext, user: User)
}

Members

constructor

method
type:
(ctx: RequestContext, user: User) => IdentifierChangeRequestEvent

LoginEvent

Package: @vendure/core File: login-event.ts

This event is fired when a user successfully logs in via the shop or admin API login mutation.

Signature

class LoginEvent extends VendureEvent {
  constructor(ctx: RequestContext, user: User)
}

Members

constructor

method
type:
(ctx: RequestContext, user: User) => LoginEvent

LogoutEvent

This event is fired when a user logs out via the shop or admin API logout mutation.

Signature

class LogoutEvent extends VendureEvent {
  constructor(ctx: RequestContext)
}

Members

constructor

method
type:
(ctx: RequestContext) => LogoutEvent

OrderStateTransitionEvent

This event is fired whenever an Order transitions from one OrderState to another.

Signature

class OrderStateTransitionEvent extends VendureEvent {
  constructor(fromState: OrderState, toState: OrderState, ctx: RequestContext, order: Order)
}

Members

constructor

method
type:
(fromState: OrderState, toState: OrderState, ctx: RequestContext, order: Order) => OrderStateTransitionEvent

PasswordResetEvent

This event is fired when a Customer requests a password reset email.

Signature

class PasswordResetEvent extends VendureEvent {
  constructor(ctx: RequestContext, user: User)
}

Members

constructor

method
type:
(ctx: RequestContext, user: User) => PasswordResetEvent

PaymentStateTransitionEvent

This event is fired whenever a Payment transitions from one PaymentState to another, e.g. a Payment is authorized by the payment provider.

Signature

class PaymentStateTransitionEvent extends VendureEvent {
  constructor(fromState: PaymentState, toState: PaymentState, ctx: RequestContext, payment: Payment, order: Order)
}

Members

constructor

method
type:
(fromState: PaymentState, toState: PaymentState, ctx: RequestContext, payment: Payment, order: Order) => PaymentStateTransitionEvent

ProductChannelEvent

This event is fired whenever a Product is added, updated or deleted.

Signature

class ProductChannelEvent extends VendureEvent {
  constructor(ctx: RequestContext, product: Product, channelId: ID, type: 'assigned' | 'removed')
}

Members

constructor

method
type:
(ctx: RequestContext, product: Product, channelId: ID, type: 'assigned' | 'removed') => ProductChannelEvent

ProductEvent

This event is fired whenever a Product is added, updated or deleted.

Signature

class ProductEvent extends VendureEvent {
  constructor(ctx: RequestContext, product: Product, type: 'created' | 'updated' | 'deleted')
}

Members

constructor

method
type:
(ctx: RequestContext, product: Product, type: 'created' | 'updated' | 'deleted') => ProductEvent

ProductVariantEvent

This event is fired whenever a ProductVariant is added, updated or deleted.

Signature

class ProductVariantEvent extends VendureEvent {
  constructor(ctx: RequestContext, variants: ProductVariant[], type: 'created' | 'updated' | 'deleted')
}

Members

constructor

method
type:
(ctx: RequestContext, variants: ProductVariant[], type: 'created' | 'updated' | 'deleted') => ProductVariantEvent

RefundStateTransitionEvent

This event is fired whenever a {@link Refund} transitions from one RefundState to another.

Signature

class RefundStateTransitionEvent extends VendureEvent {
  constructor(fromState: RefundState, toState: RefundState, ctx: RequestContext, refund: Refund, order: Order)
}

Members

constructor

method
type:
(fromState: RefundState, toState: RefundState, ctx: RequestContext, refund: Refund, order: Order) => RefundStateTransitionEvent

TaxRateModificationEvent

This event is fired whenever a TaxRate is changed

Signature

class TaxRateModificationEvent extends VendureEvent {
  constructor(ctx: RequestContext, taxRate: TaxRate)
}

Members

constructor

method
type:
(ctx: RequestContext, taxRate: TaxRate) => TaxRateModificationEvent