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)
}

Extends

Members

constructor

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

AssetEvent

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

This event is fired whenever aa Asset is added, updated or deleted.

Signature

class AssetEvent extends VendureEvent {
  constructor(ctx: RequestContext, asset: Asset, type: 'created' | 'updated' | 'deleted')
}

Extends

Members

constructor

method
type:
(ctx: RequestContext, asset: Asset, type: 'created' | 'updated' | 'deleted') => AssetEvent

AttemptedLoginEvent

This event is fired when an attempt is made to log in via the shop or admin API login mutation. The strategy represents the name of the AuthenticationStrategy used in the login attempt. If the “native” strategy is used, the additional identifier property will be available.

Signature

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

Extends

Members

constructor

method
type:
(ctx: RequestContext, strategy: string, 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[])
}

Extends

Members

constructor

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

FulfillmentStateTransitionEvent

This event is fired whenever an Fulfillment transitions from one FulfillmentState to another.

Signature

class FulfillmentStateTransitionEvent extends VendureEvent {
  constructor(fromState: FulfillmentState, toState: FulfillmentState, ctx: RequestContext, fulfillment: Fulfillment)
}

Extends

Members

constructor

method
type:
(fromState: FulfillmentState, toState: FulfillmentState, ctx: RequestContext, fulfillment: Fulfillment) => FulfillmentStateTransitionEvent

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)
}

Extends

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)
}

Extends

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)
}

Extends

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)
}

Extends

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)
}

Extends

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)
}

Extends

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)
}

Extends

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')
}

Extends

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')
}

Extends

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')
}

Extends

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)
}

Extends

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)
}

Extends

Members

constructor

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