# @provenanceauth/sdk

@provenanceauth/sdk in the Verifiers: 7 methods. Offline verifiers in the Node SDK: intent tokens, attested images, attribution traces and webhook signatures.

## Methods

### [fetchJwks](https://provenanceauth.com/docs/sdks/verify/node/fetch-jwks.md)

```ts
fetchJwks(baseUrl: string): Promise<Jwks>
```

Fetch the issuer's JWKS document.

### [verifyIntentTokenOffline](https://provenanceauth.com/docs/sdks/verify/node/verify-intent-token-offline.md)

```ts
verifyIntentTokenOffline(token: string, jwks: Jwks): Promise<OfflineVerifyResult>
```

Verify an ES256 intent token against a JWKS (authenticity + expiry only).

### [extractAttestationBundle](https://provenanceauth.com/docs/sdks/verify/node/extract-attestation-bundle.md)

```ts
extractAttestationBundle(jpeg: Uint8Array): Record<string, unknown> | null
```

Extract the embedded attestation bundle from a JPEG's provenance XMP APP1 segment, or null if the file carries none.

### [verifyAttestedImageOffline](https://provenanceauth.com/docs/sdks/verify/node/verify-attested-image-offline.md)

```ts
verifyAttestedImageOffline(jpeg: Uint8Array): Promise<MediaVerifyResult>
```

Verify an attested JPEG entirely offline in the browser: extract the bundle and check its ECDSA-P256 signature against the public key in its embedded device certificate.

### [verifyTraceManifest](https://provenanceauth.com/docs/sdks/verify/node/verify-trace-manifest.md)

```ts
verifyTraceManifest(token: string, jwks: Jwks, graph?: unknown): Promise<TraceManifestResult>
```

Verify a trace manifest against a JWKS (no network); optionally check a graph against it.

### [verifyTraceDiffManifest](https://provenanceauth.com/docs/sdks/verify/node/verify-trace-diff-manifest.md)

```ts
verifyTraceDiffManifest(token: string, jwks: Jwks, report?: unknown): Promise<TraceDiffManifestResult>
```

Verify a Neuron-CI diff manifest against a JWKS (no network) and, optionally, that a report is the one it binds.

### [verifyWebhookSignature](https://provenanceauth.com/docs/sdks/verify/node/verify-webhook-signature.md)

```ts
verifyWebhookSignature(rawBody: string, header: string | undefined | null, secret: string, opts?: WebhookVerifyOptions): Promise<WebhookVerifyResult>
```

Verify a `Provenance-Signature` header against the raw delivery body and your endpoint secret.
