> ## Documentation Index
> Fetch the complete documentation index at: https://betterdatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Signal tags

# Signal Tags integration

Integrate **Signal Tags** product authentication with the Better Data platform — verification outcomes that **start or advance loops** in the Loop Engine.

## Overview

Signal Tags bridge **physical scans** to **digital governance**. A scan produces a verification result; your integration maps that result to loop transitions (quarantine, investigation, release, etc.).

## Install

```bash theme={null}
npm install @signal-tags/sdk
```

For schema-only validation:

```bash theme={null}
npm install @signal-tags/schema
```

<Note>
  Use **`@signal-tags/verify`** for a dedicated verification client when you want HTTP calls wrapped by the published client. Validate responses with **`@signal-tags/schema`** (or exports from **`@signal-tags/sdk`**) where applicable. Hosted verification today: **verify.betterdata.co** with your HTTP client and org credentials.
</Note>

## Configure verification

Point your integration at the hosted verification base URL:

```typescript theme={null}
const VERIFY_BASE = process.env.SIGNAL_TAGS_VERIFY_URL ?? "https://verify.betterdata.co";
// Implement GET/POST to your contracted verification route; attach org credentials as required.
```

## Verify a tag (pattern)

```typescript theme={null}
type VerifyStatus = "authentic" | "tampered" | "expired" | "recalled" | string;

interface VerificationResponse {
  status: VerifyStatus;
  tagId: string;
  verifiedAt: string;
  // Plus contract-specific fields (lot, product, chain-of-custody, etc.)
}

async function verifyTag(tagId: string): Promise<VerificationResponse> {
  const res = await fetch(`${VERIFY_BASE}/v1/verify/${encodeURIComponent(tagId)}`, {
    headers: { Authorization: `Bearer ${process.env.SIGNAL_TAGS_TOKEN!}` },
  });
  if (!res.ok) throw new Error(`verify failed: ${res.status}`);
  return res.json() as Promise<VerificationResponse>;
}
```

## Triggering loops from verification

```typescript theme={null}
const result = await verifyTag(tagId);

switch (result.status) {
  case "authentic":
    // proceed with sale / fulfillment
    break;
  case "recalled":
    // await loopSystem.startLoop({ definitionId: "quarantine", context: { tagId } })
    break;
  case "tampered":
    // investigation / brand-protection loop
    break;
}
```

Wire `loopSystem` to your **Loop Engine** integration ([Loops](/platform/loops), [Hosted Loop Engine](/hosted/loops)).

## Industry applications

| Industry        | Use case                                |
| --------------- | --------------------------------------- |
| Pharmaceutical  | DSCSA serialization, recall handling    |
| Healthcare      | UDI traceability                        |
| Retail          | Anti-counterfeit, luxury authentication |
| Food & beverage | Farm-to-shelf traceability              |
| Construction    | Materials provenance                    |

## Hosted verification

The hosted endpoint at **verify.betterdata.co** adds HA operations, compliance-oriented reporting, and optional anchoring features (per contract).\
Contact **[hello@betterdata.co](mailto:hello@betterdata.co)** for access.

→ [Signal Tags (platform)](/platform/signal-tags)\
→ [Signal Tags OSS](/oss/signal-tags)\
→ [tagd.sh](https://tagd.sh)
