You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Telemetry**: Instrument your plugin with traces and metrics via `this.telemetry`. See [`ITelemetry`](api/appkit/Interface.ITelemetry.md).
249
257
-**Execution interceptors**: Use `execute()` and `executeStream()` with [`StreamExecutionSettings`](api/appkit/Interface.StreamExecutionSettings.md)
250
258
259
+
**Consuming your plugin programmatically**
260
+
261
+
Optionally, you may want to provide a way to consume your plugin programmatically using the AppKit object.
262
+
To do that, your plugin needs to implement the `exports` method, returning an object with the methods you want to expose. From the previous example, the plugin could be consumed as follows:
263
+
264
+
```ts
265
+
const AppKit =awaitcreateApp({
266
+
plugins: [
267
+
server({ port: 8000 }),
268
+
analytics(),
269
+
myPlugin(),
270
+
],
271
+
});
272
+
273
+
AppKit.myPlugin.myCustomMethod();
274
+
```
275
+
251
276
See the [`Plugin`](api/appkit/Class.Plugin.md) API reference for complete documentation.
0 commit comments