Core: The Essential Origin Verification Tool
Core is a lightweight and robust package designed to help developers streamline origin verification and integration processes in their applications. With minimal configuration, Core ensures smooth initialization and efficient origin tracking.
Features
- Seamless Integration: Easily integrate with any js based projects.
- Origin Tracking: Helps manage and verify origins dynamically.
- Lightweight and Efficient: Built with performance and simplicity in mind.
Installation
npm install @igeek/core
Usage
Initialize
(async () => {
const core = new Core();
const isVerified = await core.init();
if (isVerified) {
console.log("Initialization successful!");
} else {
console.log("Initialization failed.");
}
})();
Parameters
Parameter | Type | Description | Default |
---|
callKey | string | The API endpoint used for origin verification. | https://<your_base_url>.com |
origin | string | The identifier for the origin being verified. | "default" |
API
Core.init(): Promise<boolean>
- Description: Verifies the current origin using the provided
callKey
. - Returns:
true
if verification is successful; false
otherwise.
Use Cases
- Origin-Based Validation: Ensure only authorized origins can interact with your application.
- Dynamic Configuration: Validate runtime configurations efficiently for modular systems.
- Lightweight Authentication: Minimal overhead for quick validations.
Why Core?
Core is designed for developers who prioritize flexibility and reliability. Whether you're building a microservice, integrating third-party tools, or managing multi-origin applications, Core simplifies origin management.
License
MIT
Disclaimer
This package is intended for origin validation and tracking purposes. Misuse of this tool for unintended purposes is discouraged.