Go to file
Matt 9053de0e51 Calc App 2025-05-04 19:58:46 +02:00
.bolt Initial commit 2025-04-25 01:09:44 +02:00
public Initial commit 2025-04-25 01:09:44 +02:00
puffin-calculator-iframe Calc App 2025-05-04 19:58:46 +02:00
src Initial commit 2025-04-25 01:09:44 +02:00
.env Initial commit 2025-04-25 01:09:44 +02:00
.env.example Initial commit 2025-04-25 01:09:44 +02:00
.gitignore Initial commit 2025-04-25 01:09:44 +02:00
Dockerfile Initial commit 2025-04-25 01:09:44 +02:00
README.docker.md updates 2025-04-25 01:39:55 +02:00
README.md Initial commit 2025-04-25 01:09:44 +02:00
SIMPLE-SETUP.md more updates 2025-04-25 01:49:20 +02:00
app.js Initial commit 2025-04-25 01:09:44 +02:00
docker-compose.yml more updates 2025-04-25 01:49:20 +02:00
eslint.config.js Initial commit 2025-04-25 01:09:44 +02:00
gitea-image-push.sh updates 2025-04-25 01:39:55 +02:00
index.html Initial commit 2025-04-25 01:09:44 +02:00
nginx.conf Initial commit 2025-04-25 01:09:44 +02:00
package-lock.json Initial commit 2025-04-25 01:09:44 +02:00
package.json Initial commit 2025-04-25 01:09:44 +02:00
postcss.config.js Initial commit 2025-04-25 01:09:44 +02:00
puffin-calculator-integrated.php Made Calculator into Wordpress Plugin 2025-04-28 00:31:32 +02:00
puffin-calculator-integrated.zip Calc App 2025-05-04 19:58:46 +02:00
puffin-calculator.css Initial commit 2025-04-25 01:09:44 +02:00
puffin-calculator.js Initial commit 2025-04-25 01:09:44 +02:00
setup.sh more updates 2025-04-25 01:49:20 +02:00
tailwind.config.js Initial commit 2025-04-25 01:09:44 +02:00
tsconfig.app.json Initial commit 2025-04-25 01:09:44 +02:00
tsconfig.json Initial commit 2025-04-25 01:09:44 +02:00
tsconfig.node.json Initial commit 2025-04-25 01:09:44 +02:00
vite.config.ts Initial commit 2025-04-25 01:09:44 +02:00
vitest.config.ts Initial commit 2025-04-25 01:09:44 +02:00
wordpress-integration.php Initial commit 2025-04-25 01:09:44 +02:00

README.md

Wren API Tutorial (Node.js)

This example demonstrates how to use the Wren API to:

  1. Fetch available offset projects
  2. Create a carbon offset order

Setup

  1. Install dependencies:
npm install
  1. Create a .env file with your Wren API token:
WREN_API_TOKEN=your-token-here
  1. Run the example:
npm start

API Documentation

For full API documentation, visit: https://wren.co/api

Features

  • Environment variable configuration
  • Error handling
  • Project listing
  • Order creation
  • Response parsing

Sample Output

Fetching available offset projects...
Found 3 projects:

- Direct Air Carbon Capture (Iceland)
  Price: $250/ton
  Type: Direct Air Capture

- Coastal Mangrove Restoration (Indonesia)
  Price: $150/ton
  Type: Nature-Based

- Ocean Carbon Removal (Global Oceans)
  Price: $200/ton
  Type: Ocean-Based

Creating offset order for 1 ton of CO2...

Order created successfully!
------------------------
Order ID: ord_123abc
Amount: $200
Status: completed
Portfolio: Standard Portfolio

Portfolio projects:
- Direct Air Carbon Capture
- Coastal Mangrove Restoration