How an integration works
Timbereye is an API for forest products. Point a phone at them; get counts, measurements and tallies as data in your system. It measures sawlogs and tallies lumber and panels.
Your backend creates a group for whatever is being measured. A worker scans its pieces with a phone. Timbereye tells your backend when the measurements are in, and you update your own record. That is the whole integration: Create → Scan → Sync.
Two words carry the rest of the docs. A group is what is being measured: a container, a truckload, a pile. A piece is one thing in it: a log for sawlogs, a board or a sheet for lumber and panels. The API calls a piece an item. The examples below are logs. Everything else is in the Glossary; what each product type and SDK does is in What is available.
1. Create#
When your backend creates its own record, say ctr_4821 for container MSKU1234567, it creates the Timbereye group and keeps the group's id on that record.
const timbereye = new Timbereye() // reads TIMBEREYE_SECRET_KEY
const group = await timbereye.groups.create({
kind: "container",
externalRef: "ctr_4821",
name: "MSKU1234567",
})curl https://api.timbereye.com/v1/groups \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "kind": "container", "external_ref": "ctr_4821", "name": "MSKU1234567" }'timbereye groups create --kind container --external-ref ctr_4821 --name MSKU1234567 --json{
"id": "grp_7QxV3m",
"object": "group",
"kind": "container",
"external_ref": "ctr_4821",
"name": "MSKU1234567"
}Keep grp_7QxV3m on ctr_4821: containers are reused, so the group's id, not the container number, ties the two records together. You can preset the spec (species, length, grade) here, or leave it to the worker. Guide: Create groups.
2. Scan#
The worker scans the group's logs, choosing species, length, grade and mode in the scanner. Each log is saved on the phone as it is measured and uploaded when there is signal. Two ways:
- The Timbereye app, no mobile code. The office adds the worker by email; the worker signs in once and picks the group from the list. Guide: Scan with the Timbereye app.
- Your own iOS or Android app, with the SDK and a publishable key, which is made to ship inside an app. The iOS scanner is in the Swift SDK, the Android one in the Kotlin SDK. Guide: Scan in your app.
Timbereye.configure(publishableKey: "te_test_pk_…") // once, at launch
TimbereyeScanner(groupId: "grp_7QxV3m")Timbereye.configure(context, publishableKey = "te_test_pk_…") // once, in Application.onCreate
TimbereyeScanner(groupId = "grp_7QxV3m")3. Sync#
When the logs the worker scanned have been refined on the server, Timbereye sends your backend group.measured with the group's tally; more logs later send it again with the next revision. Your handler updates your record. Guide: Stay in sync.
const onEvent = timbereye.webhooks.handler(async (event) => {
if (event.type === "group.measured") {
const { externalRef, revision, pieces, volume } = event.data.object
await db.containers.update(externalRef, { pieces, volumeM3: volume?.m3, revision }) // keep the highest revision
}
})
app.post("/webhooks/timbereye", express.raw({ type: "application/json" }), onEvent)Your record afterwards:
| id | container | timbereye_group_id | pieces | volume_m3 |
|---|---|---|---|---|
| ctr_4821 | MSKU1234567 | grp_7QxV3m | 35 | 11.113 |
Each log, with its tag, diameters and photo, stays readable from the API at any time: Read logs, volume and photos.
Next#
- Quickstart: run all three steps in test mode now, with no phone.
- Use cases: forest scanning, mill log intake, container export, vessel export.
- Working offline: what the phone does with no signal.
- API reference and the OpenAPI document.
What is ready#
Test mode is free and open to everyone. What each product type, SDK and tool does, and the price: What is available.