An ApiKey is mostly used for authenticating non-interactive clients such as scripts or other types of services. An ApiKey is associated with a User whose permissions will apply when the ApiKey is used for authorization.
Similar to how passwords are handled, only a hash of the API key is stored in the database meaning, generated API-Keys are not viewable after creation, Users are responsible for storing them.
Hence, if a User forgets their ApiKey, the old one must be deleted and a new one created. This is called "rotating" an ApiKey.
Extends: VendureEntity
Implements: HasCustomFields, ChannelAware, Translatable, SoftDeletable
stringstringDate | nullThe API this key belongs to. The session created for the key records the same value, so a key created from a Shop API context stays refused on the Admin API however it is later presented or rotated.
Null for keys created before this column existed. Core exposes createApiKey on the Admin API
only, so those keys are treated as Admin API keys.
Date | nullUserIDUserIDChannel[]Array<Translation<ApiKey>>CustomApiKeyFieldsLocaleStringArchitecture reviews, custom plugin work, migrations, ongoing support. Get a hand from the team that builds Vendure.
Talk to the team