Releases: 1ClickImpact/makeimpact-js
Release list
Version 2.0.0
v2.0.0
The major version bump reflects a breaking change to the shape of the impact-reporting types (see Breaking Changes below).
Added
- Restore Coral API: New
restoreCoral()method to fund coral reef restoration →POST /v1/restore_coralamountis the number of coral fragments to restore (1–10,000,000)- Optional
customerEmail,customerName,notify, andmetadata - Returns
RestoreCoralResponsecontaininguserID,coralRestored,timeUTC,customer
- Cancel Impact API: New
cancelImpact()method to cancel and reverse a previously created impact →POST /v1/cancel_impact- Designed for refund flows — removes the impact from
/impacttotals and reflects on/track - Idempotent: repeat calls return
"impact was already cancelled"without double-reversing aggregates - Params:
userID(e.g."U1234"),timeUTC(ISO 8601), optionalreason(max 200 chars) - Returns
CancelImpactResponseincludinguserID,timeUTC,cancelledOn,message, and the reversed amount for the impact type (treePlanted/wasteRemoved/carbonCaptured/coralRestored/moneyDonated), plus optionalreasonandcategory
- Designed for refund flows — removes the impact from
- Donation categories:
donateMoney()now accepts an optionalcategoryparameter (e.g."veterans","animals","climate") and returnscategoryin the response - Metadata support: All impact actions (
plantTree,cleanOcean,captureCarbon,donateMoney,restoreCoral) accept an optionalmetadataobject of string→string key-value pairs- Limits: up to 20 pairs, keys ≤ 40 chars, values ≤ 500 chars; reserved keys
"gift"and"widgetID"are not allowed - Echoed back on record responses when present
- Limits: up to 20 pairs, keys ≤ 40 chars, values ≤ 500 chars; reserved keys
- Coral in reporting:
coralRestoredis now returned across the read endpoints:getImpact()— top-level total plus in theuserImpact/customerImpactbreakdownsgetDailyImpact()— per-daycoralRestoredgetRecords()/getCustomerRecords()— filter withfilterBy: "coral_restored"; coral records returned asCoralRestoredRecord/CoralRestoredRecordWithCustomertrack()—coralRestoredwhen applicable
- New Types:
RestoreCoralParams,RestoreCoralResponse,CancelImpactParams,CancelImpactResponse,CoralRestoredRecord,CoralRestoredRecordWithCustomer, and theMetadataalias (Record<string, string>)
Breaking Changes
coralRestoredadded toImpactBreakdown,ImpactResponse, andDailyImpactRecordas a new required field, positioned beforemoneyDonatedto match the API field order (treePlanted → wasteRemoved → carbonCaptured → coralRestored → moneyDonated). TypeScript code that constructs these objects directly must add the new field; code that only consumes SDK responses is unaffected at runtime.
Changed
TrackResponse: addedcoralRestored,cancelledOn, andcancellationReasonfields (the latter two populated for cancelled impacts)DonateMoneyParams/DonateMoneyResponse: addedcategory;DonateMoneyParamsalso gainedmetadataPlantTreeParams,CleanOceanParams,CaptureCarbonParams: addedmetadata- Impact record types gained an optional
metadatafield (present only when the API returns it) ImpactRecordandCustomerImpactRecordunions now include the coral record types- Enhanced test suite with full coverage for
restoreCoral(),cancelImpact(), thecategoryandmetadataparameters, and coral mapping acrossgetImpact()/getRecords()
Documentation
- Updated README with new Restore Coral, Cancel Impact, and Metadata sections
- Added
categoryexamples to the Donate Money section - Documented
coralRestoredin the Records, Impact, and Track sections, andcancelledOn/cancellationReasonin the Track response fields
Full Changelog: v1.3.0...v2.0.0
Version 1.3.0
Added
- Projects API: New
getProjects()method to retrieve all available environmental impact projects- Filter by impact type:
"trees","ocean", or"carbon" - Supports localization with
localeparameter ("en","de","es","fr","nl") - Returns full project details including name, location, description, images, coordinates, and SDG alignments
- Filter by impact type:
- Get Project by ID API: New
getProjectById(projectId)method to fetch a specific project by its unique identifier- Supports optional
localeparameter for localized content
- Supports optional
- SDG Data: Projects now include Sustainable Development Goal (SDG) alignments with full metadata — number, title, description, color, link, and icon URL
- New Types:
GetProjectsParams,GetProjectsResponse,Project,SDG
Changed
- Track API Enhancement:
TrackResponsenow includesprojectIDfield — returns the ID of the project associated with a tracked impact - Records Sorting: Added
sortOrderparameter toGetRecordsParams— allows sorting records viasort_orderquery param in bothgetRecords()andgetCustomerRecords()
Documentation
- Updated README with examples for project listing, project filtering by type, and fetching individual project details
- Added SDG field documentation to Project type section
- Improved examples showing how to integrate project data into your impact UI
Full Changelog: v1.2.2...v1.3.0
Version 1.2.2
Added
- Track API Enhancement: Added
certificatefield toTrackResponse- provides certificate URL for impacts (only available in production environment) - Impact API Breakdown: Enhanced
getImpact()to include detailed breakdown:userImpact: Impact metrics generated directly by your organizationcustomerImpact: Impact metrics generated on behalf of your customers- Both breakdown objects include
treePlanted,wasteRemoved,carbonCaptured, andmoneyDonatedfields
- Daily Impact API: New
getDailyImpact()method for time-series impact data- Returns daily impact records with date, trees planted, waste removed, carbon captured, and money donated
- Supports optional date range filtering with
startDateandendDateparameters (YYYY-MM-DD format) - New types:
GetDailyImpactResponse,DailyImpactRecord,ImpactBreakdown,GetDailyImpactParams
Changed
- Updated
ImpactResponseto includeuserImpactandcustomerImpactbreakdown fields - Enhanced documentation with examples for new impact breakdown and daily impact features
- Updated test suite to validate new fields and functionality
Documentation
- Updated README with examples for impact breakdown and daily impact retrieval
- Added certificate field documentation to Track API section
- Improved examples showing how to access direct vs customer impact metrics
Full Changelog: v1.1.0...v1.2.2
Version 1.1.0
🚀 Version 1.1.0 - Release Notes
We're excited to announce version 1.1.0 of the MakeImpact JavaScript SDK! This release introduces powerful new tracking capabilities and enhancements to help you monitor the complete lifecycle of your environmental impacts.
🆕 What's New in v1.1.0
🔍 Impact Tracking API
The headline feature of this release is the new Track API that provides real-time visibility into the entire lifecycle of your environmental impacts.
Key Capabilities:
- Real-time Status Updates: Monitor impacts from initiation through completion
- Project Location & Maps: Get geographic details with embedded Google Maps URLs
- Agent Assignment: See which organization or agent is executing your impact
- Impact Documentation: Access videos and photos of your completed impacts
- Live Session Access: Join scheduled live sessions to see your impact in action
- Donation Flow Tracking: Monitor when donations are received and sent to projects
- Test Transaction Detection: Easily identify sandbox/test transactions
Example Usage:
// Create an impact
const plantResponse = await sdk.plantTree({ amount: 1 });
// Track its complete lifecycle
const trackingInfo = await sdk.track({
userID: plantResponse.userID,
timeUTC: plantResponse.timeUTC,
});
console.log(`Tracking ID: ${trackingInfo.trackingID}`);
console.log(`Status: ${trackingInfo.impactCompleted ? 'Completed' : 'In Progress'}`);
console.log(`Location: ${trackingInfo.projectLocation}`);
console.log(`View Map: ${trackingInfo.locationMap}`);Tracking Response Fields:
trackingID- Unique identifier for this specific impactimpactInitiated- Timestamp when impact was created- Impact metrics:
treePlanted,wasteRemoved,carbonCaptured,moneyDonated assignedAgent- Organization executing the impactprojectLocation- Detailed location descriptionlocationMap- Google Maps embed URLimpactCompleted- Completion timestampimpactVideo- URL to impact documentation videoliveSessionDate- Scheduled live session timestampdonationAvailable/donationSent- Donation flow timestamps
📧 Email Notification Control
Added notify parameter to all impact creation methods, giving you control over customer email confirmations.
// Disable email notification
await sdk.plantTree({
amount: 1,
customerEmail: "user@example.com",
notify: false // Customer won't receive email
});
// Enable email notification (default behavior)
await sdk.plantTree({
amount: 1,
customerEmail: "user@example.com",
notify: true
});Note: Email notifications are always disabled in the sandbox environment regardless of this setting.
✨ Features
Environmental Impact Actions
- Plant Trees: Support reforestation efforts via simple API calls
- Clean Ocean: Remove ocean waste with automated contributions
- Capture Carbon: Offset carbon emissions seamlessly
- Donate Money: Fund causes with direct donations
Data Access & Reporting
- Retrieve Records: Query historical impact activity
- Customer Tracking: Link impact to individual users or accounts
- Impact Summaries: View total contributions across categories
Configuration & Integration
- Sandbox & Production Support: Test safely before going live
- Typed Parameters (TypeScript): Autocomplete & type safety out of the box
- Built-in Error Handling: Standardized error messages and codes
🔧 Technical Details
- ES Modules and CommonJS compatible
- Written in TypeScript, works in JavaScript too
- Tree-shakeable for optimized bundling
- Zero external dependencies
- Works in Node.js, Vite, Webpack, or modern frontend stacks
📚 Documentation
Refer to the README.md for full documentation and code examples covering all supported API features.
🎯 Getting Started
import { OneClickImpact, Environment } from "makeimpact";
// Initialize the SDK with your API key
const sdk = new OneClickImpact("your_api_key");
// Plant a tree
const response = await sdk.plantTree({ amount: 1 });
console.log(`Successfully planted ${response.treePlanted} tree(s)!`);Full Changelog: v1.0.1...v1.1.0
Version 1.0.1
🚀 Version 1.0.1 - Release
We're excited to announce the first official release of the MakeImpact JavaScript SDK! This package allows developers to easily integrate environmental impact actions into web apps, servers, or any JavaScript-based workflows.
✨ Features
Environmental Impact Actions
- Plant Trees: Support reforestation efforts via simple API calls
- Clean Ocean: Remove ocean waste with automated contributions
- Capture Carbon: Offset carbon emissions seamlessly
- Donate Money: Fund causes with direct donations
Data Access & Reporting
- Retrieve Records: Query historical impact activity
- Customer Tracking: Link impact to individual users or accounts
- Impact Summaries: View total contributions across categories
Configuration & Integration
- Sandbox & Production Support: Test safely before going live
- Typed Parameters (TypeScript): Autocomplete & type safety out of the box
- Built-in Error Handling: Standardized error messages and codes
🔧 Technical Details
- ES Modules and CommonJS compatible
- Written in TypeScript, works in JavaScript too
- Tree-shakeable for optimized bundling
- Zero external dependencies
- Works in Node.js, Vite, Webpack, or modern frontend stacks
📚 Documentation
Refer to the README.md for full documentation and code examples covering all supported API features.
🎯 Getting Started
import { OneClickImpact, Environment } from "makeimpact";
// Initialize the SDK with your API key
const sdk = new OneClickImpact("your_api_key");
// Plant a tree
const response = await sdk.plantTree({ amount: 1 });
console.log(`Successfully planted ${response.treePlanted} tree(s)!`);