<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [motion-sdk](./motion-sdk.md) &gt; [Motion](./motion-sdk.motion.md) &gt; [close](./motion-sdk.motion.close.md)

## Motion.close() method

Terminate the client and free any associated resources.

**Signature:**

```typescript
close(reason: string, cause?: MotionError): undefined | ClosedError;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

reason


</td><td>

string


</td><td>

Developer-readable explanation for the closure.


</td></tr>
<tr><td>

cause


</td><td>

[MotionError](./motion-sdk.motionerror.md)


</td><td>

_(Optional)_ Error that precipitated the closure, if any.


</td></tr>
</tbody></table>
**Returns:**

undefined \| [ClosedError](./motion-sdk.closederror.md)

## Remarks

After calling, it will be impossible to make requests to Motion under most circumstances. Some `unsafe_` methods will continue to work.

