webiny-api-tenancy-catalog

Catalogs Webiny tenancy abstractions for tenant lifecycle use cases and event handlers.

8.0k|673|Updated Jan 9, 2018
One-click install
npx skills add https://github.com/webiny/webiny-js --skill webiny-api-tenancy-catalog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webiny-api-tenancy-catalog
Source: https://github.com/webiny/webiny-js/tree/main/skills/user-skills/generated/api/tenancy
Command: npx skills add https://github.com/webiny/webiny-js --skill webiny-api-tenancy-catalog

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers extending Webiny's multi-tenant API need to locate the correct tenancy abstraction—use cases, repositories, or lifecycle event handlers—without searching the entire codebase.

Core Features & Use Cases

  • Abstraction Catalog: Lists 17 tenancy abstractions including CreateTenantUseCase, DeleteTenantUseCase, UpdateTenantUseCase, and TenantContext with exact import paths.
  • Lifecycle Event Handlers: Documents before/after hooks for tenant create, update, delete, and install events.
  • Source References: Points to the exact source file in @webiny/api-core for each abstraction so you can verify interfaces and types.
  • Use Case: When building a custom onboarding flow, look up TenantAfterCreateEventHandler to hook logic into tenant creation, then read the source file for its exact interface.

Quick Start

Ask the AI to show the Webiny tenancy abstraction for creating a tenant and its import path.

Frequently Asked Questions about webiny-api-tenancy-catalog

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a tenant programmatically in Webiny?

Use CreateTenantUseCase imported from webiny/api/tenancy, which creates a new tenant and persists it via CreateTenantRepository. Read the source at @webiny/api-core/features/tenancy/CreateTenant/index.ts for the exact interface.

How to hook into tenant lifecycle events in Webiny?

Webiny provides event handler abstractions such as TenantBeforeCreateEventHandler, TenantAfterCreateEventHandler, TenantAfterDeleteEventHandler, and TenantInstalledEventHandler. Implement the handler interface and register it to run logic around tenant lifecycle transitions.

What is TenantContext used for in Webiny API?

TenantContext provides access to the current tenant and supports tenant-scoped execution within the Webiny API. It is imported from webiny/api/tenancy and defined in @webiny/api-core/features/tenancy/TenantContext.

Does Webiny support installing apps on a tenant with rollback?

Yes, the AppInstaller abstraction installs an application on a tenant with rollback support, while InstallTenantUseCase runs all registered app installers for a tenant. Both are exported from webiny/api/tenancy.

Where are Webiny tenancy abstractions implemented?

All tenancy abstractions live in the @webiny/api-core package under features/tenancy, with subdirectories per operation such as CreateTenant, DeleteTenant, UpdateTenant, and InstallTenant. Each abstraction entry lists its exact source file.