@pilotoo/connections-core
Introduction
Section titled “Introduction”@pilotoo/connections-core is the framework-free half of Connections. It holds the connection model, the AES-GCM vault cipher, the OAuth 2 client, the credential resolver, the sharing policy, the provider catalog and the ConnectionStorage port a host implements. It also ships the built-in providers. Use it directly when your backend is not NestJS, or take @pilotoo/connections-server for the NestJS adapter.
Installation
Section titled “Installation”@pilotoo/connections-core is at version 0.1.0, is marked private and is not published to a registry. It is also not part of the tarballs that pnpm release:check packs, so today it is used from the kit workspace:
pnpm installpnpm --filter @pilotoo/connections-core buildInside the workspace, depend on it with "@pilotoo/connections-core": "workspace:^". Its build first builds the kit packages it depends on.
Basic usage
Section titled “Basic usage”The built-in providers are plain values you pass to the host:
import { githubProvider, gmailProvider, mailProvider } from '@pilotoo/connections-core';
const providers = [githubProvider(), gmailProvider(), mailProvider()];Build the services yourself over your own ConnectionStorage, or take the Postgres one from @pilotoo/connections-server. Using the library walks through both.
Entry points
Section titled “Entry points”| Import | Provides |
|---|---|
@pilotoo/connections-core |
The only entry point. |
What it exports, by role:
| Role | Names |
|---|---|
| Services | ConnectionService, ConnectionAdminService, ConnectionGatewayService, ConnectionCredentialResolver and the audit and logger types. |
| Vault | AesGcmCredentialCipher, the CredentialCipher port. |
| OAuth | The OAuth client and its client configuration. |
| Catalog | ProviderCatalog and the provider and credential-type model. |
| Providers | githubProvider, gmailProvider, logicpanelHubProvider, mailProvider, googleOAuth2CredentialType, imapSmtpCredentialType. |
| Tool sources | The ConnectionToolSource port, createRemoteToolSource and createCompositeToolSource. |
| Ports | ConnectionStorage, and the MailTransport port that @pilotoo/connections-mail implements. |
| Custom gateways | The gateway broker and client that connect a tool gateway by URL or by a polling worker. |
Dependencies
Section titled “Dependencies”@pilotoo/chat-protocol, @logicpanel/lphub and zod. It has no peer dependencies, and no Nest or pg.
Learn more
Section titled “Learn more”- Providers: defining one and what the admin supplies.
- Using the library and Remote sources.