function · Browser and Node

# issueCredential

Creates and signs a VC-shaped credential with a fresh UUID and the issuer's DID.

`@toip-tools/trust-core` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/trust-core/src/credentials.ts#L66)

Import:

```ts
import { issueCredential } from "@toip-tools/trust-core";
```

## Declaration

Signature:

```ts
issueCredential(issuer: Identity, clock: Clock, body: CredentialBody): Credential;
```

### Parameters

**`issuer` (required)**

`Identity`

Identity that issues and signs the credential.

**`clock` (required)**

`Clock`

Supplies `validFrom` and the proof creation time.

**`body` (required)**

`CredentialBody`

Credential types, subject claims, optional expiry, and optional status-list reference.

### Returns

`Credential`

A credential with the W3C VC v2 context and a Data Integrity proof.

[Usage guide](https://toip.tools/toolkit/trust-core/#usage) · [Error handling](https://toip.tools/toolkit/trust-core/#errors) · [All exports](https://toip.tools/toolkit/trust-core/api/)

---

This is the Markdown version of https://toip.tools/toolkit/trust-core/api/issueCredential/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
