
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@app-connect/core
Advanced tools
Core package for RingCentral App Connect project providing modular APIs for CRM integration, authentication, contact management, and call logging.
npm install @app-connect/core
const { createCoreApp, connectorRegistry } = require('@app-connect/core');
const myCRMConnector = require('./connectors/myCRM');
const manifest = require('./connectors/manifest.json');
// Set the default manifest for the connector registry. This ensures that all connectors
// have access to the necessary configuration and metadata before registration.
connectorRegistry.setDefaultManifest(manifest);
// Register your CRM connectors. The default manifest must be set before registration
// to ensure proper initialization of the connector with the required settings.
connectorRegistry.registerConnector('myCRM', myCRMConnector, manifest);
// Create Express app with all core functionality
const app = createCoreApp();
// Add your custom routes
app.get('/my-custom-route', (req, res) => {
res.send('Hello from custom route!');
});
exports.getServer = () => app;
The connector registry supports dynamic interface registration, allowing you to extend connector functionality without modifying the original connector:
const { connectorRegistry } = require('@app-connect/core');
// Register interface functions for a platform
async function customCreateCallLog({ user, contactInfo, authHeader, callLog, note }) {
// Custom implementation
return {
logId: 'custom-log-id',
returnMessage: {
message: 'Call logged with custom implementation',
messageType: 'success',
ttl: 2000
}
};
}
async function customFindContact({ user, authHeader, phoneNumber }) {
// Custom implementation
return [
{
id: 'custom-contact-id',
name: 'Custom Contact',
type: 'Contact',
phone: phoneNumber,
additionalInfo: null
}
];
}
// Register interface functions
connectorRegistry.registerConnectorInterface('myCRM', 'createCallLog', customCreateCallLog);
connectorRegistry.registerConnectorInterface('myCRM', 'findContact', customFindContact);
// Register the base connector
connectorRegistry.registerConnector('myCRM', myCRMConnector);
// Get composed connector with interfaces
const composedConnector = connectorRegistry.getConnector('myCRM');
Interface-Only Connectors (No Base Connector):
// Register only interface functions, no base connector
connectorRegistry.registerConnectorInterface('interfaceOnlyCRM', 'createCallLog', customCreateCallLog);
connectorRegistry.registerConnectorInterface('interfaceOnlyCRM', 'findContact', customFindContact);
// Get interface-only connector
const interfaceOnlyConnector = connectorRegistry.getConnector('interfaceOnlyCRM');
console.log('Interface-only methods:', Object.keys(interfaceOnlyConnector));
// Output: ['createCallLog', 'findContact']
// Later, you can add a base connector
connectorRegistry.registerConnector('interfaceOnlyCRM', myCRMConnector);
const fullConnector = connectorRegistry.getConnector('interfaceOnlyCRM');
console.log('Full connector methods:', Object.keys(fullConnector));
// Output: ['getAuthType', 'getUserInfo', 'updateCallLog', 'unAuthorize', 'createContact', 'createCallLog', 'findContact']
const express = require('express');
const {
createCoreRouter,
createCoreMiddleware,
initializeCore,
connectorRegistry
} = require('@app-connect/core');
const myCRMConnector = require('./connectors/myCRM');
const manifest = require('./connectors/manifest.json');
// Set manifest
connectorRegistry.setDefaultManifest(manifest);
// Register connectors
connectorRegistry.registerConnector('myCRM', myCRMConnector, manifest);
// Initialize core services
initializeCore();
// Create your own Express app
const app = express();
// Add custom middleware first
app.use(express.static('public'));
app.use('/api/v2', customApiMiddleware);
// Apply core middleware
const coreMiddleware = createCoreMiddleware();
coreMiddleware.forEach(middleware => app.use(middleware));
// Add core routes
const coreRouter = createCoreRouter();
app.use('/', coreRouter);
// Add custom routes
app.get('/my-custom-route', (req, res) => {
res.send('Hello from custom route!');
});
createCoreApp(options)Creates a complete Express app with all core functionality.
Parameters:
options (Object, optional): Configuration options
skipDatabaseInit (Boolean): Skip database initialization (default: false)skipAnalyticsInit (Boolean): Skip analytics initialization (default: false)Returns: Express application instance
createCoreRouter()Creates an Express router with all core routes.
Returns: Express router instance
createCoreMiddleware()Returns an array of core middleware functions.
Returns: Array of middleware functions
initializeCore(options)Initializes core services (database, analytics).
Parameters:
options (Object, optional): Configuration options
skipDatabaseInit (Boolean): Skip database initialization (default: false)skipAnalyticsInit (Boolean): Skip analytics initialization (default: false)connectorRegistry.setDefaultManifest(manifest)Sets the default manifest for connectors.
Parameters:
manifest (Object): Default manifestconnectorRegistry.registerConnector(name, connector, manifest)Registers a CRM connector.
Parameters:
name (String): Connector nameconnector (Object): Connector implementationmanifest (Object, optional): Connector manifestconnectorRegistry.registerConnectorInterface(platformName, interfaceName, interfaceFunction)Registers an interface function for a specific platform that will be composed with the connector at retrieval time.
Parameters:
platformName (String): Platform identifier (e.g., 'pipedrive', 'salesforce')interfaceName (String): Interface function name (e.g., 'createCallLog', 'findContact')interfaceFunction (Function): The interface function to registerExample:
async function customCreateCallLog({ user, contactInfo, authHeader, callLog, note }) {
// Custom implementation
return {
logId: 'custom-log-id',
returnMessage: {
message: 'Call logged with custom implementation',
messageType: 'success',
ttl: 2000
}
};
}
connectorRegistry.registerConnectorInterface('myCRM', 'createCallLog', customCreateCallLog);
connectorRegistry.getConnector(name)Retrieves a registered connector with composed interfaces.
Parameters:
name (String): Connector nameReturns: Composed connector object or interface-only object
Behavior:
connectorRegistry.getOriginalConnector(name)Retrieves the original connector without any composed interface functions.
Parameters:
name (String): Connector nameReturns: Original connector object
connectorRegistry.getPlatformInterfaces(platformName)Returns a Map of registered interface functions for a platform.
Parameters:
platformName (String): Platform identifierReturns: Map of interface functions
connectorRegistry.hasPlatformInterface(platformName, interfaceName)Checks if a specific interface function is registered for a platform.
Parameters:
platformName (String): Platform identifierinterfaceName (String): Interface function nameReturns: Boolean indicating if interface exists
connectorRegistry.unregisterConnectorInterface(platformName, interfaceName)Unregisters an interface function for a platform.
Parameters:
platformName (String): Platform identifierinterfaceName (String): Interface function nameconnectorRegistry.getConnectorCapabilities(platformName)Gets comprehensive information about an connector including its capabilities and registered interfaces.
Parameters:
platformName (String): Platform identifierReturns: Promise with Object with connector capabilities information
const authHandler = require('@app-connect/core/handlers/auth');
const contactHandler = require('@app-connect/core/handlers/contact');
const logHandler = require('@app-connect/core/handlers/log');
const adminHandler = require('@app-connect/core/handlers/admin');
const userHandler = require('@app-connect/core/handlers/user');
const dispositionHandler = require('@app-connect/core/handlers/disposition');
// Available handlers:
// authHandler - Authentication operations
// contactHandler - Contact management
// logHandler - Call/message logging
// adminHandler - Admin operations
// userHandler - User management
// dispositionHandler - Call disposition
const { UserModel } = require('@app-connect/core/models/userModel');
const { CallLogModel } = require('@app-connect/core/models/callLogModel');
const { MessageLogModel } = require('@app-connect/core/models/messageLogModel');
const { AdminConfigModel } = require('@app-connect/core/models/adminConfigModel');
const { CacheModel } = require('@app-connect/core/models/cacheModel');
// Available models:
// UserModel - User data model
// CallLogModel - Call log data model
// MessageLogModel - Message log data model
// AdminConfigModel - Admin configuration model
// CacheModel - Cache data model
const jwt = require('@app-connect/core/lib/jwt');
const analytics = require('@app-connect/core/lib/analytics');
const util = require('@app-connect/core/lib/util');
// Available utilities:
// jwt - JWT token management
// analytics - Analytics tracking
// util - General utilities
The core package provides the following API endpoints:
GET /authValidation - Validate user authenticationGET /oauth-callback - OAuth callback handlerPOST /apiKeyLogin - API key authenticationPOST /unAuthorize - Logout userGET /contact - Find contacts by phone numberPOST /contact - Create new contactGET /custom/contact/search - Search contacts by nameGET /callLog - Retrieve call logsPOST /callLog - Create call logPATCH /callLog - Update call logPUT /callDisposition - Set call dispositionPOST /messageLog - Create message logGET /user/settings - Get user settingsPOST /user/settings - Update user settingsGET /user/preloadSettings - Preload user settingsGET /admin/settings - Get admin settingsPOST /admin/settings - Update admin settingsGET /admin/serverLoggingSettings - Get server logging settingsPOST /admin/serverLoggingSettings - Update server logging settingsGET /releaseNotes - Get release notesGET /crmManifest - Get CRM manifestGET /is-alive - Health checkGET /serverVersionInfo - Get server versionGET /hostname - Get user hostnameGET /userInfoHash - Get hashed user infoThe core package uses the following environment variables:
DATABASE_URL - Database connection string for Sequelize ORMDISABLE_SYNC_DB_TABLE - Skip database table synchronizationOVERRIDE_APP_SERVER - Override app server URL in manifestsHASH_KEY - Key for hashing user informationAPP_SERVER_SECRET_KEY - Server secret keyIS_PROD - Production environment flagDYNAMODB_LOCALHOST - Local DynamoDB endpoint for development, used for lock cacheCore Package
├── Handlers (Business Logic)
│ ├── auth.js - Authentication logic
│ ├── contact.js - Contact management
│ ├── log.js - Call/message logging
│ ├── admin.js - Admin operations
│ ├── user.js - User management
│ └── disposition.js - Call disposition
├── Models (Data Layer)
│ ├── userModel.js
│ ├── callLogModel.js
│ ├── messageLogModel.js
│ ├── adminConfigModel.js
│ └── cacheModel.js
├── Utils (Utilities)
│ ├── jwt.js - JWT operations
│ ├── analytics.js - Analytics tracking
│ └── util.js - General utilities
├── Connector Registry
│ └── registry.js - CRM connector management
└── API Layer
├── createCoreApp() - Complete app setup
├── createCoreRouter() - Route management
├── createCoreMiddleware() - Middleware management
└── initializeCore() - Service initialization
FAQs
RingCentral App Connect Core
We found that @app-connect/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.