Installation
Install the documented release set and choose a supported runtime.
Pinned npm release set
For a reproducible baseline:
npm install @forcecalendar/core@2.5.7 @forcecalendar/interface@1.9.0Core alone is useful for server-side computation:
npm install @forcecalendar/core@2.5.7Add the adapter for your framework:
npm install @forcecalendar/react@0.3.1
# OR
npm install @forcecalendar/vue@0.3.1Keep the Core and Interface peers installed. React requires React 18 or later; Vue requires Vue 3.3 or later. Adapter 0.3 requires Interface 1.6 or later; its readOnly support requires Interface 1.8 or later. The documented release set above includes both features.
Core imports
Core is ESM and has no runtime package dependencies. Use a maintained Node.js release for server workloads. fetch-based ICS helpers need a runtime with fetch, AbortController and the relevant network permissions; downloadAsFile() is browser-only. Optional search Workers have a synchronous fallback.
| Import | Exports |
|---|---|
@forcecalendar/core | Public classes, VERSION, and default Calendar |
@forcecalendar/core/calendar | Calendar |
@forcecalendar/core/events | Event |
@forcecalendar/core/state | StateManager |
@forcecalendar/core/search | EventSearch |
@forcecalendar/core/ics | ICSHandler |
@forcecalendar/core/types | Shared TypeScript types |
import { Calendar, Event, TimezoneManager, ConflictDetector } from '@forcecalendar/core';
import { ICSHandler } from '@forcecalendar/core/ics';LRUCache, PerformanceOptimizer, AdaptiveMemoryManager and TimezoneDatabase are internal utilities, not root exports. Do not deep-import unexported package paths.
Browser Interface
import '@forcecalendar/interface';This registers <forcecal-main> and <forcecal-event-form>. Named imports from the same entry point also run its registration side effects. Interface needs a browser DOM, Custom Elements and Shadow DOM; use the framework adapters for client-side registration during SSR rather than importing Interface in server-only code.
Core declarations are generated from source. Interface also owns the global HTMLElementTagNameMap entry for forcecal-main:
import type { ForceCalendarElement } from '@forcecalendar/interface';
const calendar: ForceCalendarElement = document.createElement('forcecal-main');See Quick start for snapshot loading and migration for readiness and cleanup.
Salesforce
Use the Salesforce distribution or released unlocked installer, not npm commands inside the org. Deploy matching LWC, Apex and static-resource versions together. The integration uses API 62.0 metadata and requires Lightning Web Security. Legacy Lightning Locker is unsupported.
Follow deployment, then select the minimum appropriate permissions. No permission set is assigned automatically.
Compatibility checks
Test your actual browser and host policies. In particular:
- The Interface uses Shadow DOM styles and inline style properties. A strict
style-srcpolicy needs host-specific validation; absence ofeval()alone does not establish full CSP compatibility. - The grid and visible range use the browser's local timezone even when
timezoneis configured. - An SSR-safe adapter does not make browser-only imperative methods callable on the server.
- Read-only UI is separate from server authorization.
- Headless tool integrations use the host application's persistence and authorization; the Core library does not supply a remote calendar service.