Skip to content

TIP

This page mirrors packages/core/README.md from the repository. Edit it at the source, not here.

@saasweave/core

Shared domain contracts: feature catalog, webhook types, media asset helpers, and asset utilities.

Feature catalog

DEFAULT_FEATURES seeds the feature_flag table with shipped capabilities only. Admin toggles live flags at /admin/features.

KeySurfacePlans
api_keys/app/api-keysstarter+
webhooks/app/webhooksgrowth+
ai_assistant/app/ai-usage (usage metrics)starter+
ssoSettings SSO panelscale, enterprise
audit_logs/app/auditscale+
usage_billingconsole.recordUsagegrowth+

PLANNED_FEATURES lists roadmap items (TODO, not in DB, not toggleable): batch_jobs, custom_models, shared_workspaces, invoicing.

Webhooks

  • WEBHOOK_EVENTSmember.added, usage.recorded, api_key.*, etc.
  • buildWebhookPayload() — canonical outbound payload shape

Media

  • buildMediaAssetKey() — storage key convention
  • resolveMediaPublicUrl() — public URL from key + base

Key exports

@saasweave/core/features
@saasweave/core/webhooks
@saasweave/core/media-asset
@saasweave/core/assets

Environment variables

None directly — consumed by api/db/jobs.

Tests

bash
pnpm --filter @saasweave/core test:unit

Released under the MIT License.