Skip to content

AIDK API Reference / aidk-kernel / UserContext

Interface: UserContext ​

Defined in: packages/kernel/src/context.ts:28

User information associated with the current execution context.

This is typically populated from authentication/authorization systems and flows through all operations via the KernelContext.

Example ​

typescript
const ctx = Context.create({
  user: {
    id: 'user-123',
    tenantId: 'tenant-abc',
    roles: ['admin', 'editor'],
    email: 'user@example.com', // Custom fields allowed
  }
});

See ​

KernelContext.user - Where user context is stored

Indexable ​

ts
[key: string]: any

Additional user properties (extensible)

Properties ​

PropertyTypeDescriptionDefined in
idstringUnique identifier for the userpackages/kernel/src/context.ts:30
roles?string[]User's roles for authorizationpackages/kernel/src/context.ts:34
tenantId?stringMulti-tenant organization identifierpackages/kernel/src/context.ts:32

Released under the MIT License.