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

# authorization/device-authorization-client API

> Source-derived exports, parameter and result types, public methods and source links.

This reference is generated from the checked-out TypeScript exports. Types and signatures describe the package contract; source presence does not establish deployment or service availability. Error expressions below are direct throws, not an exhaustive list of failures from dependencies.

[Source module](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts). See the [reference index](https://trust-link-tsn.mintlify.site/sdk/api-reference.md) for package import boundaries and verification scope.

## authorizeDevice

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/authorization`. [Implementation, line 65](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L65).

```ts theme={null}
authorizeDevice(params: { authorizationServiceUrl: string; tin: string; deviceId: string; signingPublicKey: JsonWebKey; encryptionPublicKey: JsonWebKey; permissions: string[]; historyRecoveryScope: HistoryRecoveryScope; selectedReceiptIds?: string[]; wallet: TsnOwnerMessageSigner; fetch?: typeof fetch; }): Promise<DeviceAuthorizationState>
```

Direct failure expressions:

```text theme={null}
new Error("TSN authorization service returned an unsupported challenge")
new Error("TSN registration challenge is bound to another TIN")
```

## DeviceAuthorizationState

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/authorization`. [Implementation, line 22](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L22).

### DeviceAuthorizationState.ownerVerified

[Source, line 23](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L23).

```ts theme={null}
ownerVerified: true
```

### DeviceAuthorizationState.deviceAuthorized

[Source, line 24](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L24).

```ts theme={null}
deviceAuthorized: true
```

## getDeviceAuthorizationState

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/authorization`. [Implementation, line 59](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L59).

```ts theme={null}
getDeviceAuthorizationState(value: DeviceAuthorizationState): DeviceAuthorizationState
```

## TsnOwnerMessageSigner

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/authorization`. [Implementation, line 27](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L27).

### TsnOwnerMessageSigner.publicKey

[Source, line 28](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L28).

```ts theme={null}
publicKey: string
```

### TsnOwnerMessageSigner.signMessage

[Source, line 29](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L29).

```ts theme={null}
signMessage(message: Uint8Array): Promise<Uint8Array>
```

## verifyOwnerAuthorization

Import from `@trustlink/tsn-sdk` or `@trustlink/tsn-sdk/authorization`. [Implementation, line 47](https://github.com/bigdreamsweb3/trustlink-pay/blob/main/tsn-protocol/sdks/tsn-sdk/src/authorization/device-authorization-client.ts#L47).

```ts theme={null}
verifyOwnerAuthorization(value: unknown): DeviceAuthorizationState
```

Direct failure expressions:

```text theme={null}
new Error("TSN authorization service did not confirm owner and device authorization")
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.