Check4Me Extension Documentation
The Check4Me Extension allows you to integrate BECE and WASSCE results checking functionality directly into your website. This documentation will guide you through the setup process and explain how to use the extension.
Quick Start: If you're in a hurry, jump to the Basic Usage section to get started with minimal setup.
Getting Started
To use the Check4Me Extension, you need to:
- Sign up for a Check4US account
- Generate an API key from your Check4US account
- Include the extension script in your HTML
- Initialize the extension with your API key
Important: Keep your API key secure. Do not expose it in client-side code. If your key is compromised, revoke it immediately and generate a new one.
Including the Extension
Add the following script tag to your HTML:
<script src="https://seahorse-app-guifi.ondigitalocean.app/check4me-extension.umd.js"></script>
Basic Usage
Create a container element in your HTML:
<div id="check4me-container"></div>
Initialize the extension with your API key:
const checker = new Check4MeExtension({
apiKey: 'YOUR_API_KEY',
container: '#check4me-container',
theme: 'light', // or 'dark'
examType: 'BECE' // default exam type
});
Configuration Options
Option | Type | Default | Description |
---|---|---|---|
apiKey |
String | null | Your Check4Me API key (required) |
apiUrl |
String | 'https://api.check4us.site/e/api' | API endpoint URL |
container |
String | Element | null | Container element or selector (required) |
containerId |
String | null | ID of the container element (alternative to container) |
examType |
String | 'BECE' | Default exam type ('BECE' or 'WASSCE') |
category |
String | 'School' | Default category ('School' or 'Private') |
theme |
String | 'light' | UI theme ('light' or 'dark') |
year |
Number | Current year | Default examination year |
onSuccess |
Function | null | Callback function when results are successfully retrieved |
onError |
Function | null | Callback function when an error occurs |
onLoading |
Function | null | Callback function when results are being loaded |
showPdf |
Boolean | true | Whether to show PDF viewer in results |
Events
The extension provides callback functions for various events:
onSuccess
Called when results are successfully retrieved:
const checker = new Check4MeExtension({
// ...other options
onSuccess: function(data) {
console.log('Results retrieved:', data);
// data.results contains the student information and grades
// data.pdf contains the PDF URL if available
}
});
onError
Called when an error occurs:
const checker = new Check4MeExtension({
// ...other options
onError: function(error) {
console.error('Error:', error);
// Handle the error appropriately
}
});
onLoading
Called when results are being loaded:
const checker = new Check4MeExtension({
// ...other options
onLoading: function() {
console.log('Loading results...');
// Show custom loading indicator if needed
}
});
Live Demo
Extension Sandbox
To see a live demo, initialize the extension with your API key above.