@botim/framework
v1.1.3
Published
Init Botim Framework
Keywords
Readme
@botim/framework
Core runtime for BOTIM Mini Programs that initializes the host bridge and exposes a ready-to-use BOT instance.
Installation
pnpm add @botim/framework@botim-scoped packages resolve to the internal npm registry (see the repo .npmrc). It also has a peer dependency on @botim/bridge (>=57.0.0).
Usage
useFramework boots the framework once and resolves with the bridge instance after the app launches. useBOT returns the cached BOT instance (the same one set on window.BOT).
import { useFramework, useBOT } from '@botim/framework';
// Initialize once (registering twice logs a warning).
const BOT = await useFramework({ showLog: false });
// Retrieve the bridge instance anywhere afterwards.
const bot = useBOT();Part of the mp-fw-plugin monorepo.
