Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@bpmromandie/notification-service-lib
Advanced tools
The `@bpmromandie/notification-service-lib` is a library for sending notifications via different channels such as email, SMS, and UI. It provides a simple API to integrate notification services into other microservices and comes with built-in support for
The @bpmromandie/notification-service-lib
is a library for sending notifications via different channels such as email, SMS, and UI. It provides a simple API to integrate notification services into other microservices and comes with built-in support for checking notification service health.
npm login --registry=https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/ --auth-type=web
npm run build
npm publish
npm view @bpmromandie/notification-service-lib --registry=https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/
You can install the library using npm from our private Artifactory registry (https://bin.swisscom.com/artifactory):
npm install @bpmromandie/notification-service-lib --registry=https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/
Or if you're testing locally and using npm link
npm link notification-service-lib
Or if you using npm pack for local testing
cd ../libs/notification-service-lib
npm pack
import NotificationService from '@bpmromandie/notification-service-lib';
To send a notification, we need to create an instance of notificationService and use the sendNotification method.
const notificationService = new NotificationService({
baseURL: process.env.API_NOTIFICATION_URL || 'http://localhost:6003',// Fallback to a default URL
timeout: 10000, // Optional: You can set a custom timeout (default is 5000ms)
});
const notificationContent = {
subject: 'KYC Rievew',
body: 'Please verify your account by clicking the link.',
recipient: 'user@example.com',
};
// Sending an email notification
notificationService.sendNotification('email', notificationContent)
.then(response => {
console.log('Notification sent successfully:', response);
})
.catch(error => {
console.error('Failed to send notification:', error);
});
To verify if the notification service is running, use the checkNotificationConnection method:
notificationService.checkNotificationConnection()
.then(isHealthy => {
if (isHealthy) {
console.log('Notification service is healthy');
} else {
console.log('Notification service is down');
}
})
.catch(error => {
console.error('Error checking service health:', error);
});
When initializing the NotificationService, you can configure the following options:
const notificationService = new NotificationService({
baseURL: 'http://localhost:6003',
timeout: 8000,
});
constructor(config: { baseURL: string; timeout?: number });
Sends a notification via the specified channel.
node_modules
and package-lock.json
.npm
is installed and available in your system's PATH..npmrc
)..npmrc
Configuration (Recommended)For the correct registry settings, add the following to your project's .npmrc
file:
# Use the default npm registry for public packages
registry=https://registry.npmjs.org/
# Use the private Artifactory registry for @bpmromandie scope
@bpmromandie:registry=https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/
This ensures that public packages are fetched from the public registry and private packages (under @bpmromandie) are fetched from your Artifactory registry.
Open a terminal.
Navigate to the project directory.
Make sure the script is executable:
chmod +x clean-and-install.sh
Run the script:
./clean-and-install.sh
The script will:
./clean-and-install.ps1
Are you sure you want to clean and install (y/n)? y
[INFO] Starting clean and install process...
[INFO] Cleaning up old node_modules and package-lock.json...
[INFO] Removed node_modules.
[INFO] Removed package-lock.json.
[INFO] Cleaning npm cache...
[INFO] Installing public npm packages from https://registry.npmjs.org/...
[INFO] Installing private npm packages from https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/...
[INFO] Installing @bpmromandie/notification-service-lib...
[INFO] Installing @bpmromandie/kyc_common_types...
[INFO] All packages installed successfully.
Press any key to close...
This includes a development Dockerfile (Dockerfile.dev
) that sets up a Node.js development environment with nodemon
for hot reloading, installs public and private npm packages, and runs your app as a non-root user.
nodemon
for automatic app restarts upon file changes..env.default
to .env
..npmrc
is correctly configured for authentication..npmrc
Configuration for Private NPM RegistryIf your project uses private npm packages (e.g., @bpmromandie
scope), you must configure .npmrc
with the correct registry and credentials. Here's an example .npmrc
file:
@bpmromandie:registry=https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/
//bin.swisscom.com/artifactory/api/npm/kyc-npm-local/:username=YOUR_USERNAME
//bin.swisscom.com/artifactory/api/npm/kyc-npm-local/:_password=YOUR_BASE64_ENCODED_PASSWORD
//bin.swisscom.com/artifactory/api/npm/kyc-npm-local/:email=YOUR_EMAIL
FAQs
The `@bpmromandie/notification-service-lib` is a library for sending notifications via different channels such as email, SMS, and UI. It provides a simple API to integrate notification services into other microservices and comes with built-in support for
We found that @bpmromandie/notification-service-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.