Skip to content

Releases: 1ClickImpact/makeimpact-js

Version 2.0.0

Choose a tag to compare

@1ClickImpact 1ClickImpact released this 02 Sep 17:58

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_coral
    • amount is the number of coral fragments to restore (1–10,000,000)
    • Optional customerEmail, customerName, notify, and metadata
    • Returns RestoreCoralResponse containing userID, 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 /impact totals and reflects on /track
    • Idempotent: repeat calls return "impact was already cancelled" without double-reversing aggregates
    • Params: userID (e.g. "U1234"), timeUTC (ISO 8601), optional reason (max 200 chars)
    • Returns CancelImpactResponse including userID, timeUTC, cancelledOn, message, and the reversed amount for the impact type (treePlanted / wasteRemoved / carbonCaptured / coralRestored / moneyDonated), plus optional reason and category
  • Donation categories: donateMoney() now accepts an optional category parameter (e.g. "veterans", "animals", "climate") and returns category in the response
  • Metadata support: All impact actions (plantTree, cleanOcean, captureCarbon, donateMoney, restoreCoral) accept an optional metadata object 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
  • Coral in reporting: coralRestored is now returned across the read endpoints:
    • getImpact() — top-level total plus in the userImpact / customerImpact breakdowns
    • getDailyImpact() — per-day coralRestored
    • getRecords() / getCustomerRecords() — filter with filterBy: "coral_restored"; coral records returned as CoralRestoredRecord / CoralRestoredRecordWithCustomer
    • track() — coralRestored when applicable
  • New Types: RestoreCoralParams, RestoreCoralResponse, CancelImpactParams, CancelImpactResponse, CoralRestoredRecord, CoralRestoredRecordWithCustomer, and the Metadata alias (Record<string, string>)

Breaking Changes

  • coralRestored added to ImpactBreakdown, ImpactResponse, and DailyImpactRecord as a new required field, positioned before moneyDonated to 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: added coralRestored, cancelledOn, and cancellationReason fields (the latter two populated for cancelled impacts)
  • DonateMoneyParams / DonateMoneyResponse: added category; DonateMoneyParams also gained metadata
  • PlantTreeParams, CleanOceanParams, CaptureCarbonParams: added metadata
  • Impact record types gained an optional metadata field (present only when the API returns it)
  • ImpactRecord and CustomerImpactRecord unions now include the coral record types
  • Enhanced test suite with full coverage for restoreCoral(), cancelImpact(), the category and metadata parameters, and coral mapping across getImpact() / getRecords()

Documentation

  • Updated README with new Restore Coral, Cancel Impact, and Metadata sections
  • Added category examples to the Donate Money section
  • Documented coralRestored in the Records, Impact, and Track sections, and cancelledOn / cancellationReason in the Track response fields

Full Changelog: v1.3.0...v2.0.0

Version 1.3.0

Choose a tag to compare

@1ClickImpact 1ClickImpact released this 30 Mar 01:45

Added

  • Projects API: New getProjects() method to retrieve all available environmental impact projects
    • Filter by impact type: "trees", "ocean", or "carbon"
    • Supports localization with locale parameter ("en", "de", "es", "fr", "nl")
    • Returns full project details including name, location, description, images, coordinates, and SDG alignments
  • Get Project by ID API: New getProjectById(projectId) method to fetch a specific project by its unique identifier
    • Supports optional locale parameter for localized content
  • 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: TrackResponse now includes projectID field — returns the ID of the project associated with a tracked impact
  • Records Sorting: Added sortOrder parameter to GetRecordsParams — allows sorting records via sort_order query param in both getRecords() and getCustomerRecords()

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

Choose a tag to compare

@1ClickImpact 1ClickImpact released this 09 Jan 16:30

Added

  • Track API Enhancement: Added certificate field to TrackResponse - 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 organization
    • customerImpact: Impact metrics generated on behalf of your customers
    • Both breakdown objects include treePlanted, wasteRemoved, carbonCaptured, and moneyDonated fields
  • 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 startDate and endDate parameters (YYYY-MM-DD format)
    • New types: GetDailyImpactResponse, DailyImpactRecord, ImpactBreakdown, GetDailyImpactParams

Changed

  • Updated ImpactResponse to include userImpact and customerImpact breakdown 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

Choose a tag to compare

@1ClickImpact 1ClickImpact released this 17 Oct 19:07

🚀 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 impact
  • impactInitiated - Timestamp when impact was created
  • Impact metrics: treePlanted, wasteRemoved, carbonCaptured, moneyDonated
  • assignedAgent - Organization executing the impact
  • projectLocation - Detailed location description
  • locationMap - Google Maps embed URL
  • impactCompleted - Completion timestamp
  • impactVideo - URL to impact documentation video
  • liveSessionDate - Scheduled live session timestamp
  • donationAvailable / 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

Choose a tag to compare

@1ClickImpact 1ClickImpact released this 20 May 17:26

🚀 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)!`);