UserBase

db · /index·type

Document shape for a platform user. Carries an embedded list of OAuth identities and satisfies the NextAuth adapter contract — specifically the optional avatar and nullable emailVerified fields that the adapter reads after User.create and User.find. email is unique; the constraint is enforced inside the Convex db/users:create mutation (the migrated form of the old Mongo unique index).

Definition

@nordcom/commerce-db
type UserBase = BaseDocument & { avatar: string; email: string; emailVerified: Date | null; groups: string[]; identities: IdentityBase[]; name: string };

BaseDocument & { avatar: string; email: string; emailVerified: Date | null; groups: string[]; identities: IdentityBase[]; name: string }

Example

import type { UserBase } from '@nordcom/commerce-db';
function displayName(user: UserBase): string {
    return user.name;
}

FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme

Sourceuser.ts:19Edit the JSDoc directly
Metadata@nordcom/commerce-db@0.1.0Open in GitHub ↗

On this page