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]: anyAdditional user properties (extensible)
Properties ​
| Property | Type | Description | Defined in |
|---|---|---|---|
id | string | Unique identifier for the user | packages/kernel/src/context.ts:30 |
roles? | string[] | User's roles for authorization | packages/kernel/src/context.ts:34 |
tenantId? | string | Multi-tenant organization identifier | packages/kernel/src/context.ts:32 |